We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c5e7b7 commit f40fdabCopy full SHA for f40fdab
.gitignore
@@ -1 +1,2 @@
1
.DS_Store
2
+/.idea/
index.js
@@ -1,7 +1,12 @@
module.exports = function() {
return function (req, res, next) {
3
if (req.path === '/healthcheck') {
4
- return res.status(200).end();
+ if (res.headersSent) {
5
+ console.warn('Attempted end response after headers were sent');
6
+ return next();
7
+ } else {
8
+ return res.status(200).end();
9
+ }
10
}
11
next();
12
0 commit comments