mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 02:45:22 +00:00
THRIFT-5184: Fix header check for WebSocket connections
When establishing a WebSocket connection, Firefox sends Connection: keep-alive, Upgrade instead of just Connection: Upgrade. Check to see if Upgrade is in the header instead of checking to see if it is the entire header value. Client: d
This commit is contained in:
parent
c3728122d2
commit
7c4bdf9914
@ -121,7 +121,7 @@ protected:
|
||||
upgrade_ = sicmp(upgrade, "websocket") == 0;
|
||||
} else if (startsWith!compToLower(split[0], cast(ubyte[])"connection")) {
|
||||
auto connection = stripLeft(cast(const(char)[])split[2]);
|
||||
connection_ = sicmp(connection, "upgrade") == 0;
|
||||
connection_ = canFind(connection.toLower, "upgrade");
|
||||
} else if (startsWith!compToLower(split[0], cast(ubyte[])"sec-websocket-key")) {
|
||||
auto secWebSocketKey = stripLeft(cast(const(char)[])split[2]);
|
||||
auto hash = sha1Of(secWebSocketKey ~ WEBSOCKET_GUID);
|
||||
|
Loading…
Reference in New Issue
Block a user