We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
v11.10.0
6.8.0
4.29.6
3.6.0
I am working with a custom middleware to serve static assets from their gzipped versions, like so:
app.use(function (req, res, next) { if (req.url.endsWith('css')) { req.url = req.url + '.gz'; res.set('Content-Encoding', 'gzip'); res.set('Content-Type', 'text/css'); } next() });
Unfortunately, webpack-dev-middleware overwrites Content-Type regardless of whether or not it's been set already by another middleware. See
webpack-dev-middleware
Content-Type
webpack-dev-middleware/lib/middleware.js
Line 82 in e5bd8f8
In the resulting request: Content-Type: text/css
Content-Type: text/css
In the resulting request: Content-Type: application/gzip; charset=UTF-8
Content-Type: application/gzip; charset=UTF-8
The text was updated successfully, but these errors were encountered:
@clshortfuse you had some trouble with incorrect mimeTypes set by webpack-dev-middleware. Is this problem similar?
Sorry, something went wrong.
We should add check if header already exists, feel free to send a PR with fix 👍
Do not overwrite Content-Type
b7561de
When the Content-Type header is already present (for example it has been set by other middleware) we do not overwrite it. Closes webpack#376
Release https://github.com/webpack/webpack-dev-middleware/releases/tag/v3.6.1
No branches or pull requests
v11.10.0
6.8.0
4.29.6
3.6.0
Code
I am working with a custom middleware to serve static assets from their gzipped versions, like so:
Unfortunately,
webpack-dev-middleware
overwritesContent-Type
regardless of whether or not it's been set already by another middleware. Seewebpack-dev-middleware/lib/middleware.js
Line 82 in e5bd8f8
Expected Behavior
In the resulting request:
Content-Type: text/css
Actual Behavior
In the resulting request:
Content-Type: application/gzip; charset=UTF-8
For Bugs; How can we reproduce the behavior?
For Features; What is the motivation and/or use-case for the feature?
The text was updated successfully, but these errors were encountered: