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 refactored my app to use in memory buffers instead of files. However an undesired side effect is that for all responses where we do res.send(buf) without setting an explicit res.type() express now defaults to:
Content-Type: application/octet-stream
I do not want this. Is there a workaround to use res.send(buffer) without setting any content-type automatically?
I know I can explicitly override it with res.type("bla/bla") but for many resources there is not a known type. In these cases I want to set no content-type response header.
This discussion was converted from issue #6223 on December 13, 2024 15:44.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I refactored my app to use in memory buffers instead of files. However an undesired side effect is that for all responses where we do
res.send(buf)
without setting an explicitres.type()
express now defaults to:I do not want this. Is there a workaround to use
res.send(buffer)
without setting any content-type automatically?I know I can explicitly override it with
res.type("bla/bla")
but for many resources there is not a known type. In these cases I want to set no content-type response header.I am using express 5.0.1.
Beta Was this translation helpful? Give feedback.
All reactions