dont allow to cache error pages (#3962)

This commit is contained in:
Dmitry Molotkov 2018-09-25 18:16:15 +03:00 committed by Sébastien Chopin
parent ccc9e7e174
commit 4061b6fd87

View File

@ -21,6 +21,7 @@ export default function errorMiddleware(err, req, res, next) {
res.statusMessage = err.name res.statusMessage = err.name
res.setHeader('Content-Type', type + '; charset=utf-8') res.setHeader('Content-Type', type + '; charset=utf-8')
res.setHeader('Content-Length', Buffer.byteLength(content)) res.setHeader('Content-Length', Buffer.byteLength(content))
res.setHeader('Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate')
// Send Response // Send Response
res.end(content, 'utf-8') res.end(content, 'utf-8')