[fix] set connection to CLOSE in cases where the agent is false.

This commit is contained in:
Jarrett Cruger 2014-03-26 22:07:09 -04:00
parent a7b16eb136
commit 89a22bc003

View File

@ -45,6 +45,15 @@ common.setupOutgoing = function(outgoing, options, req, forward) {
outgoing.agent = options.agent || false;
//
// Remark: If we are false set the connection: close. This is the right thing to do
// as node core doesn't handle this COMPLETELY properly yet.
//
if(!outgoing.agent) {
outgoing.headers = outgoing.headers || {};
outgoing.headers.connection = 'close';
}
//
// Remark: Can we somehow not use url.parse as a perf optimization?
//