mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 21:38:33 +00: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
@ -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…
x
Reference in New Issue
Block a user