forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to prevent late/duplicate response errors (github#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
- Loading branch information
1 parent
930b266
commit 2dbae93
Showing
8 changed files
with
39 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters