mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
Added check for HTTP version and GET method when upgrading WebSocket to comply with RFC 6455. (#23332)
This commit is contained in:
parent
e1c6af2840
commit
6b6dc1cd3a
1 changed files with 5 additions and 0 deletions
|
|
@ -23,6 +23,11 @@ pub fn init(
|
|||
send_buffer: []u8,
|
||||
recv_buffer: []align(4) u8,
|
||||
) InitError!bool {
|
||||
switch (request.head.version) {
|
||||
.@"HTTP/1.0" => return false,
|
||||
.@"HTTP/1.1" => if (request.head.method != .GET) return false,
|
||||
}
|
||||
|
||||
var sec_websocket_key: ?[]const u8 = null;
|
||||
var upgrade_websocket: bool = false;
|
||||
var it = request.iterateHeaders();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue