I am trying to run the sample application with the customized header but when i try to run this application, it throws the error as "Content Encoding Error". I would like to add this custom header on my application to use the grunt-gzip compression. can anyone tell why this error comes and how to resolve it?
var express = require('express'); var app = express();
app.get('/', function(req, res){ res.setHeader('Content-Encoding', 'gzip') res.send('hello world'); }); app.listen(3001)
Content-Encoding: gzipheader, but you are nor correctly serving gzip'ed content (i.e.,hello worldis not a valid output for the gzip algorithm). This isn't an answer because I'm not sure how to resolve it (although searching forexpress gzipgive s a few promising results)