commit 8c5cb13f12e8f0854fe570f2f0e10fbcb6f94f19
parent 0bc23c4db0e25f37852c327a47d98e4f7bcef91b
Author: Valentin Gosu <valentin.gosu@gmail.com>
Date: Sat, 8 Nov 2025 10:11:29 +0000
Bug 1998130 - Firefox should not include keep-alive in websocket Connection header r=necko-reviewers,kershaw
https://datatracker.ietf.org/doc/html/rfc6455
> The request MUST contain an |Upgrade| header field whose value
> MUST include the "websocket" keyword.
Technically Firefox's behaviour is correct, but it appears some servers just check
for exact Connection: Upgrade - Chrome and Safari don't include the keep-alive token,
so I guess this is now a web-compat issue.
Differential Revision: https://phabricator.services.mozilla.com/D271206
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -2027,7 +2027,7 @@ nsresult nsHttpChannel::SetupChannelForTransaction() {
rv = mRequestHead.SetHeader(nsHttp::Upgrade, mUpgradeProtocol, false);
MOZ_ASSERT(NS_SUCCEEDED(rv));
rv = mRequestHead.SetHeaderOnce(nsHttp::Connection, nsHttp::Upgrade.get(),
- true);
+ false);
MOZ_ASSERT(NS_SUCCEEDED(rv));
mCaps |= NS_HTTP_STICKY_CONNECTION;
mCaps &= ~NS_HTTP_ALLOW_KEEPALIVE;