mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] set connection to CLOSE in cases where the agent is false.
This commit is contained in:
parent
a7b16eb136
commit
89a22bc003
@ -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?
|
||||
//
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user