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

Streaming fails to recognise "Upgrade: WebSocket" case insensitive #378

Open
nickandrew opened this issue Dec 21, 2014 · 0 comments
Open

Comments

@nickandrew
Copy link

Connecting to wss://stream-channel.app.net/stream/user the success of the connection depends on the exact case in the Upgrade: header.

Fail case:

GET /stream/user?access_token=WHATEVER HTTP/1.1
Upgrade: WebSocket
Connection: Upgrade
Host: stream-channel.app.net
Authorization: Bearer WHATEVER
Origin: https://stream-channel.app.net
Sec-WebSocket-Key: UbkaXXkVWOn33stTE1Ua8g==
Sec-WebSocket-Version: 13

Returns:

HTTP/1.1 200 OK
Server: nginx/1.6.0
Date: Sun, 21 Dec 2014 16:26:13 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
[etc]

Changing only to Upgrade: websocket results in success:

HTTP/1.1 101 Switching Protocols
Server: nginx/1.6.0
Date: Sun, 21 Dec 2014 16:28:29 GMT
Connection: upgrade
Upgrade: websocket
Sec-WebSocket-Accept: TWqVfqfvXuSuwtfaeIFrPh/+F/g=
[etc]

The perl library I'm using is Protocol::WebSocket and it has the mixed-case string hardcoded. RFC6455 section 4.2.1 (which I believe is the relevant RFC) says the value must be case-insensitive.

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

No branches or pull requests

1 participant