Skip to content

Commit 51eeebe

Browse files
committed
handle 'upgrade' in comma-separated connection header
Firefox sends `keep-alive, upgrade`, not just `upgrade`, which the proxy incorrectly turned into `close`
1 parent 554f59c commit 51eeebe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: lib/http-proxy/common.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ common.setupOutgoing = function(outgoing, options, req, forward) {
5353
if (!outgoing.agent) {
5454
outgoing.headers = outgoing.headers || {};
5555
if (typeof outgoing.headers.connection !== 'string'
56-
|| outgoing.headers.connection.toLowerCase() !== 'upgrade'
56+
|| !outgoing.headers.connection.toLowerCase().split(',').some(
57+
function (s) { if (s.trim() === 'upgrade') { return true; } })
5758
) { outgoing.headers.connection = 'close'; }
5859
}
5960

0 commit comments

Comments
 (0)