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
I have searched existing issues to ensure the bug has not already been reported
Fastify version
5.1.0
Plugin version
8.0.2
Node.js version
20.18.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
11
Description
v8.x does not respect existing content-type headers when serving files and overwrites them here using headers returned by a @fastify/send call. This was not the case in previous versions of the plugin.
Spotted this as I set the content-type of a static file using reply.type() here, and it's overwriting it.
Link to code that reproduces the bug
No response
Expected Behavior
For the plugin to check if content-type is already set, and use it if so.
The text was updated successfully, but these errors were encountered:
Fdawgs
changed the title
Plugin overwrites existing content-type and content-encoding headers
Plugin overwrites existing content-type headers
Nov 11, 2024
Fdawgs
changed the title
Plugin overwrites existing content-type headers
Plugin overwrites existing content-type header
Nov 11, 2024
Prerequisites
Fastify version
5.1.0
Plugin version
8.0.2
Node.js version
20.18.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
11
Description
v8.x does not respect existing
content-type
headers when serving files and overwrites them here using headers returned by a@fastify/send
call. This was not the case in previous versions of the plugin.Spotted this as I set the content-type of a static file using
reply.type()
here, and it's overwriting it.Link to code that reproduces the bug
No response
Expected Behavior
For the plugin to check if
content-type
is already set, and use it if so.The text was updated successfully, but these errors were encountered: