From eca49375b02608f7de751569834a1b996f11dd15 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Sun, 3 Dec 2017 15:49:44 +1300 Subject: [PATCH] Add $request->isHEAD() --- src/Middleware/TrailingSlashRedirector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Middleware/TrailingSlashRedirector.php b/src/Middleware/TrailingSlashRedirector.php index 850fe53..c632f36 100644 --- a/src/Middleware/TrailingSlashRedirector.php +++ b/src/Middleware/TrailingSlashRedirector.php @@ -17,7 +17,7 @@ class TrailingSlashRedirector implements HTTPMiddleware { public function process(HTTPRequest $request, callable $delegate) { - if ($request && $request->isGET()) { + if ($request && ($request->isGET() || $request->isHEAD())) { $requested_url = $_SERVER['REQUEST_URI']; $expected_url = rtrim(Director::baseURL() . $request->getURL(), '/') . '/'; $urlPathInfo = pathinfo($requested_url);