Skip to content

Commit

Permalink
refactor(response): remove _sent flag
Browse files Browse the repository at this point in the history
  • Loading branch information
hekike committed Nov 18, 2017
1 parent 0da8219 commit 8d255c6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 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
5 changes: 0 additions & 5 deletions lib/server.js
Expand Up @@ -1118,11 +1118,6 @@ Server.prototype._routeErrorResponse = function _routeErrorResponse(
}

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

// Expose only knonw errors
if (_.isNumber(err.statusCode)) {
res.send(err);
Expand Down

0 comments on commit 8d255c6

Please sign in to comment.