I have the following code
const compress = require('compression');
export const handleCompression = compress({
filter: function (req: express.Request, res: express.Response) {
return (/json|text|javascript|css|font|svg/).test(res.getHeader('Content-Type'));
},
level: 9
});
I get this warning from TypeScript:
Would it be correct to change the call to:
res.get('Content-Type')
?
Yes or better: req.header('Content-Type')
.
See footer here.