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 self.headers.host
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)
No comment? If I could at least get some more information, I'd submit a pull request.
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.
Thanks! See #380