From 67344d44f68f27eeb25138634e6c1b181ff03835 Mon Sep 17 00:00:00 2001 From: Serge Kvashnin <75180587+serge-kvashnin@users.noreply.github.com> Date: Sun, 24 Mar 2024 21:15:03 +0100 Subject: [PATCH] Add note about `HEAD` requests. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 85aae75..11715f4 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,11 @@ $router->delete('/orders/{id}', 'delete_order_handler'); You can use these shortcut methods just like you would use the route method, but without the need to specify the HTTP method as the first argument. +> [!IMPORTANT] +> The router only facilitates matching `HEAD` requests to `GET` routes when a specific `HEAD` handler is not found. +> Developers must explicitly ensure that `HEAD` method calls always return +> [empty response bodies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD). + ## Tests Run the PHPUnit tests to ensure that the package is functioning as expected: