Skip to content

Commit

Permalink
Workaround for GitHub issue request#2807 (request#2808)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgonzal authored and reconbot committed Dec 1, 2018
1 parent 43c53ce commit 2f04c3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 167 deletions.
167 changes: 0 additions & 167 deletions lib/auth.js

This file was deleted.

10 changes: 10 additions & 0 deletions request.js
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,16 @@ Request.prototype.onRequestError = function (error) {
clearTimeout(self.timeoutTimer)
self.timeoutTimer = null
}

// This is a workaround for a race condition caused by the way that lib/redirect.js
// calls Request.init() when processing an HTTP redirect:
// https://github.com/request/request/issues/2807
// Somehow we end up with an ECONNRESET error from a socket that has already
// been destroyed and returned to the pool.
if (self.req && self.req.socket && self.req.socket.destroyed) {
return
}

self.emit('error', error)
}

Expand Down

0 comments on commit 2f04c3c

Please sign in to comment.