Skip to content

Commit

Permalink
refactor(server): use res.headersSent instead of res._sent
Browse files Browse the repository at this point in the history
  • Loading branch information
hekike committed Nov 20, 2017
1 parent b7d4e5f commit c4202e4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions lib/response.js
Expand Up @@ -346,8 +346,6 @@ function patch(Response) {
var log = self.log;
var code, body, headers, format;

self._sent = true;

// derive arguments from types, one by one
var index = 0;
// Check to see if the first argument is a status code
Expand Down
2 changes: 1 addition & 1 deletion lib/server.js
Expand Up @@ -1084,7 +1084,7 @@ Server.prototype._routeErrorResponse = function _routeErrorResponse(

self._emitErrorEvents(req, res, null, err, function emitError(emitErr) {
// Prevent double handling
if (res._sent) {
if (res.headersSent) {
return;
}

Expand Down

0 comments on commit c4202e4

Please sign in to comment.