Skip to content

Instantly share code, notes, and snippets.

@dydx
Created March 6, 2015 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dydx/7f03e5620f09166ad340 to your computer and use it in GitHub Desktop.
Save dydx/7f03e5620f09166ad340 to your computer and use it in GitHub Desktop.
// so this is a thing that was successfully used to "fix" a headers race condition in an Express app.
// Jesus christ this is stupid
function(req, res, next) {
var originalSend = res.send
res.send = function() {
if (this.headersSent()) return
originalSend.apply(this, arguments)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment