Try to prevent late/duplicate response errors (#20077)
* Ensure all Express 'next' calls include 'return's * Add headersSent checks during archived versions flow * Return a 404 earlier if archived resource fetch fails * Short-circuit responses for archived stuff * Be more careful about responding to and short-circuiting after search requests * Fix tests
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
const { FEATURE_NEXTJS } = process.env;
|
||||
const { FEATURE_NEXTJS } = process.env
|
||||
|
||||
module.exports = function isNextRequest(req, res, next) {
|
||||
req.renderWithNextjs = false;
|
||||
module.exports = function isNextRequest (req, res, next) {
|
||||
req.renderWithNextjs = false
|
||||
|
||||
if (FEATURE_NEXTJS) {
|
||||
req.renderWithNextjs = true;
|
||||
req.renderWithNextjs = true
|
||||
}
|
||||
|
||||
next();
|
||||
};
|
||||
return next()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user