Summary
HEAD requests are returning 404 Not Found in cases where the same route succeeds for GET.
This shows up clearly in live ntnt apps such as template.heylarri.com, where:
GET / returns 200
HEAD / returns 404
GET /health returns 200
HEAD /health returns 404
Expected behavior
Per RFC 9110 section 9.3.2, HEAD should behave like GET except without the response body when a resource supports GET.
At minimum, ntnt should not return 404 for HEAD when the corresponding GET route exists.
Repro
In an ntnt app with a normal homepage route and health route:
curl http://127.0.0.1:8080/ -> 200
curl -I http://127.0.0.1:8080/ -> currently 404
curl http://127.0.0.1:8080/health -> 200
curl -I http://127.0.0.1:8080/health -> currently 404
Notes
The async server code appears to have explicit HEAD fallback logic, so this likely means one of:
- the live/runtime path is not consistently using that logic
- route matching is bypassing the HEAD fallback in another code path
- there is a mismatch between interpreter/server route dispatch paths
Proposed fix direction
Audit all HTTP server / interpreter route dispatch paths and make sure HEAD:
- resolves against explicit HEAD handlers when present
- falls back to GET when GET exists
- preserves headers/status and strips the body
- behaves consistently for dynamic routes and static files
Summary
HEADrequests are returning404 Not Foundin cases where the same route succeeds forGET.This shows up clearly in live ntnt apps such as
template.heylarri.com, where:GET /returns200HEAD /returns404GET /healthreturns200HEAD /healthreturns404Expected behavior
Per RFC 9110 section 9.3.2,
HEADshould behave likeGETexcept without the response body when a resource supports GET.At minimum, ntnt should not return 404 for
HEADwhen the correspondingGETroute exists.Repro
In an ntnt app with a normal homepage route and health route:
curl http://127.0.0.1:8080/->200curl -I http://127.0.0.1:8080/-> currently404curl http://127.0.0.1:8080/health->200curl -I http://127.0.0.1:8080/health-> currently404Notes
The async server code appears to have explicit HEAD fallback logic, so this likely means one of:
Proposed fix direction
Audit all HTTP server / interpreter route dispatch paths and make sure HEAD: