Closed michaelfranzl closed 7 years ago
What node version? Also we have no code like this and express-minify is working. Obviously we modify the Content-Type
when we need but I've never seen this requirement of your code snippet.
Node 6.9.4. I debugged some more and found out that my issue had to do with caching. When express decides to send a 304 Not modified, the Content-Type header is undefined. The Basic Usage example works. Sorry for the noise.
express-minify needs a Content-Type header on the response before it does anything. Express doesn't set this by default, so one needs a custom middleware before the express-minify middleware.
So your Basic Usage example should be extended in the following way so that it works 'out of the box', to save developers some time debugging.
I'm using express 4.14.0 and express-minify 0.2.0.