1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Fix #3900 return 404 on asset hash mismatch in prod (#3941)

* Fix #3900 return 404 on asset hash mismatch in prod

* Make INVALID_BUILD_ID return 404
This commit is contained in:
Tim Teeling 2018-03-31 03:01:46 -04:00 committed by Tim Neutkens
parent b43af823dd
commit 9ec81c00fa

View file

@ -127,7 +127,7 @@ export async function renderScriptError (req, res, page, error) {
// Asks CDNs and others to not to cache the errored page
res.setHeader('Cache-Control', 'no-store, must-revalidate')
if (error.code === 'ENOENT') {
if (error.code === 'ENOENT' || error.message === 'INVALID_BUILD_ID') {
res.statusCode = 404
res.end('404 - Not Found')
return