diff --git a/lib/response.js b/lib/response.js index 0fd75d3ff..a7ab2196e 100644 --- a/lib/response.js +++ b/lib/response.js @@ -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 diff --git a/lib/server.js b/lib/server.js index f8006ece3..8d4748734 100644 --- a/lib/server.js +++ b/lib/server.js @@ -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; }