From 787427b21119576c45ff6c3f6e352965aa9e1c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Tue, 23 Jun 2020 15:23:33 +0200 Subject: [PATCH] MAPG-166 response to HEAD request with the GET content --- src/Routing/RouteCollection.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Routing/RouteCollection.php b/src/Routing/RouteCollection.php index d93007a..1430002 100644 --- a/src/Routing/RouteCollection.php +++ b/src/Routing/RouteCollection.php @@ -45,6 +45,11 @@ class RouteCollection { $groupNumber = count($uri); + // response to HEAD request with the GET content + if ($method === 'head') { + $method = 'get'; + } + if (!isset($this->searchTable[$method][$groupNumber])) { return null; }