mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
handle 'upgrade' in comma-separated connection header
Firefox sends `keep-alive, upgrade`, not just `upgrade`, which the proxy incorrectly turned into `close`
This commit is contained in:
parent
554f59c518
commit
51eeebef68
@ -53,7 +53,8 @@ common.setupOutgoing = function(outgoing, options, req, forward) {
|
|||||||
if (!outgoing.agent) {
|
if (!outgoing.agent) {
|
||||||
outgoing.headers = outgoing.headers || {};
|
outgoing.headers = outgoing.headers || {};
|
||||||
if (typeof outgoing.headers.connection !== 'string'
|
if (typeof outgoing.headers.connection !== 'string'
|
||||||
|| outgoing.headers.connection.toLowerCase() !== 'upgrade'
|
|| !outgoing.headers.connection.toLowerCase().split(',').some(
|
||||||
|
function (s) { if (s.trim() === 'upgrade') { return true; } })
|
||||||
) { outgoing.headers.connection = 'close'; }
|
) { outgoing.headers.connection = 'close'; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user