-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StreamableFile overrides Content-Type header #7586
Comments
This happen due to the following lines nest/packages/platform-express/adapters/express-adapter.ts Lines 32 to 35 in 72a88d5
And the commit message of b862e9c made by @jmcdo29 states this behavior. But this behaves differently from fastify, which under the hood sets to nest/packages/platform-fastify/adapters/fastify-adapter.ts Lines 147 to 151 in 72a88d5
|
then we could do something like this for express ... |
Lets track this here #7589 |
Feature Request
Is your feature request related to a problem? Please describe.
StreamableFile set a fixed content-type header of application/octet-stream, even if you set an other like response.header('content-type', 'image/svg')
https://github.com/dzunftmeister-evorhei/nest-streamablefile-res-issue
nest run start:dev
http://localhost:3000/fileTestInline
Describe the solution you'd like
there should be a possibility to set the content-type header to get inline view of files working
e.g. new StreamableFile(file, {contentType: 'image/svg'})
Teachability, Documentation, Adoption, Migration Strategy
What is the motivation / use case for changing the behavior?
The text was updated successfully, but these errors were encountered: