diff options
author | penenin <penenin@users.noreply.github.com> | 2020-04-27 01:11:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-27 09:11:47 +0100 |
commit | 7c4bdf9914fcba6c89e0f69ae48b9675578f084a (patch) | |
tree | 2309efb79421d20cbb18876736dcac54a5bba1d3 /lib/d | |
parent | c3728122d2ddb2e0236b1e08bdb5e24b8baae9dd (diff) | |
download | thrift-7c4bdf9914fcba6c89e0f69ae48b9675578f084a.tar.gz |
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
Diffstat (limited to 'lib/d')
-rw-r--r-- | lib/d/src/thrift/transport/websocket.d | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/d/src/thrift/transport/websocket.d b/lib/d/src/thrift/transport/websocket.d index 25d1f7d01..b800e519e 100644 --- a/lib/d/src/thrift/transport/websocket.d +++ b/lib/d/src/thrift/transport/websocket.d @@ -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); |