nicholas icon indicating copy to clipboard operation
nicholas copied to clipboard

HEAD requests generate 404

Open apparentorder opened this issue 5 years ago • 0 comments

Currently, any HEAD request on a post's (slug) URL will return HTTP/404 Not found.

This seems to be related to the request routing code, e.g.

$router->map('GET','/[:slug]/', function($slug) {

I can change this to read GET|HEAD instead, and it actually generates HTTP/200 for HEAD requests then, but it does also output Content-Length: 0 in this case, which is wrong. It's still better than returning a 404, but clearly not the correct fix.

Is there an easy way to generate proper HEAD responses in nicholas?

TIA!

apparentorder avatar Apr 28 '21 14:04 apparentorder