You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For HEAD routes, we are not sending the body so the content-length is always 0, but the RFC stands that the server MAY sent the real content-length without the payload
It is actually a regression introduced in #436
I over-looked the wildcard case and think that exposeHeadRoute may works, but actually based on the current implementation it is not.
Prerequisites
Fastify version
4.26.2
Plugin version
7.0.2
Node.js version
18.19.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Ubuntu 22.04.4 LTS
Description
Just write a simple static files server.
Then HTTP HEAD method to get an exists file info:
curl -I http://localhost:8089/x.txt
The wrong is the headRouteOnSendHandler(
fastify/lib/headRoute.js
) rewrite the content-length to 0.remove this should be ok.
Steps to Reproduce
Server:
Client:
curl -I http://localhost:8089/x.txt
Expected Behavior
Get the file size correctly.
The text was updated successfully, but these errors were encountered: