Skip to content

Only upgrade a GET that carries Upgrade: websocket - #1966

Open
mattkrick wants to merge 1 commit into
uNetworking:masterfrom
mattkrick:fix/require-upgrade-header
Open

mattkrick wants to merge 1 commit into
uNetworking:masterfrom
mattkrick:fix/require-upgrade-header

Conversation

@mattkrick

@mattkrick mattkrick commented Nov 11, 2026 •

Copy link
Copy Markdown

RFC 6455 §4.2.1 says an upgrade needs an upgrade header.
Some client firewalls (or pentesters? who knows) strip the upgrade header, but leave Sec-WebSocket-Key.
Any load balancer that complies with the RFC sees this as a regular GET, but uWS still treats it as an upgrade. So when uWS upgrades the connection, the load balancer wasn't expecting an upgrade & it 502s (or 503s, depending on the LB).

With this PR, we don't upgrade a client unless they correctly ask for an upgrade.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant