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

Added check for http GET method and http version when upgrading WebSocket to comply with RFC 6455. #23332

Merged
merged 4 commits into from
Mar 25, 2025

Conversation

Marzin-bot
Copy link
Contributor

Added check for http GET method when upgrading WebSocket to comply with RFC 6455.
See https://tools.ietf.org/html/rfc6455

Copy link
Collaborator

@linusg linusg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a check for the version, they're both part of the same requirement in the RFC. ("An HTTP/1.1 or higher GET request")

@Marzin-bot Marzin-bot force-pushed the master branch 2 times, most recently from b216452 to 2eab7fa Compare March 24, 2025 17:11
…ttp2 requires the CONNECT method. Therefore, it is best to check the method for each http version in a switch block
@Marzin-bot
Copy link
Contributor Author

http2 is not supported. The WebSocket connection upgrade method for http2 requires the CONNECT method. Therefore, it is best to check the method for each http version in a switch block:

switch (request.head.version) {
        .@"HTTP/1.0" => return false,
        .@"HTTP/1.1" => if (request.head.method != .GET) return false,
 }

@Marzin-bot Marzin-bot changed the title Added check for http GET method when upgrading WebSocket to comply with RFC 6455. Added check for http GET method and http version when upgrading WebSocket to comply with RFC 6455. Mar 24, 2025
@alexrp alexrp requested a review from linusg March 25, 2025 13:57
@alexrp alexrp merged commit 6b6dc1c into ziglang:master Mar 25, 2025
9 checks passed
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.

3 participants