ECONNRESET when using forever agent #349

mac- opened this Issue Oct 22, 2012 · 3 comments


None yet

2 participants

mac- commented Oct 22, 2012

Node v0.8.8
Request v2.11.4
Ubuntu 10.04 server

When using the forever agent, there are times where a socket becomes disconnected due to an ECONNRESET error, and there is code (self.clientErrorHandler) to retry the request, however, on the second attempt the host header is removed from the request object, and I get "400 Bad Request - Invalid hostname" responses from the server I am making the request to.

On this line:

if (self.setHost) delete

the host header is being deleted, and actually commenting out that line resolves my issues. My question is, why is this needed? Can we get rid of it or move it below this conditional:

 if (self.req._reusedSocket && error.code === 'ECONNRESET' && self.agent.addRequestNoreuse)
mac- commented Nov 21, 2012

No comment? If I could at least get some more information, I'd submit a pull request.

mikeal commented Nov 21, 2012

i don't know why that line is there. it may have just been copied from the forwarding retry logic. i think we can safely remove it.

mac- commented Nov 28, 2012

Thanks! See #380

@mac- mac- closed this Nov 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment