From 296c9b57d5d2a0c9d10054fb605999c2163c389f Mon Sep 17 00:00:00 2001 From: Belle Aerni Date: Fri, 15 Mar 2024 23:18:23 -0700 Subject: [PATCH] Also register HEAD for GET routes --- flight/net/Router.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flight/net/Router.php b/flight/net/Router.php index f739a24..43c3f18 100644 --- a/flight/net/Router.php +++ b/flight/net/Router.php @@ -107,6 +107,10 @@ class Router $methods = explode('|', $method); } + if (in_array('GET', $methods) && !in_array('HEAD', $methods)) { + $methods[] = 'HEAD'; + } + // And this finishes it off. if ($this->group_prefix !== '') { $url = rtrim($this->group_prefix . $url);