Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] WebSocket server does not send 426 Upgrade Required #915

Open
1 task done
sirzooro opened this issue May 2, 2024 · 0 comments
Open
1 task done

[BUG] WebSocket server does not send 426 Upgrade Required #915

sirzooro opened this issue May 2, 2024 · 0 comments
Labels

Comments

@sirzooro
Copy link

sirzooro commented May 2, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

WebSocket server sends error 400 Bad Request when HTTP connection cannot be upgraded to WebSocket what is misleading - recently I had to exchange few emails with someone before I found that he was sending regular HTTP request instead of opening WS.

Expected Behavior

Send error 426 Upgrade Required as specified in RFCs:

RFC 9110 - HTTP Semantics:

The 426 (Upgrade Required) status code indicates that the server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. The server MUST send an Upgrade header field in a 426 response to indicate the required protocol(s) (Section 7.8).

RFC 6455 - The WebSocket Protocol

   /version/
      The |Sec-WebSocket-Version| header field in the client's
      handshake includes the version of the WebSocket Protocol with
      which the client is attempting to communicate.  If this
      version does not match a version understood by the server, the
      server MUST abort the WebSocket handshake described in this
      section and instead send an appropriate HTTP error code (such
      as 426 Upgrade Required) and a |Sec-WebSocket-Version| header
      field indicating the version(s) the server is capable of
      understanding.

Steps To Reproduce

No response

Anything else?

No response

@sirzooro sirzooro added the bug label May 2, 2024
@sirzooro sirzooro changed the title [BUG] <title>WebSocket server does not send 426 Upgrade Required [BUG] WebSocket server does not send 426 Upgrade Required May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant