Skip to content

WebSocket handshake should be case insensitive #9

Closed
@maben-mw

Description

@maben-mw

While all supported browsers do appear to use Connection: Upgrade with capital U and Upgrade: websocket with all lower case "websocket", and so the case-sensitive matches to Upgrade and websocket in app.py:

if (
reqH.get("connection") == "Upgrade"
and reqH.get("upgrade") == "websocket"
and req.method == "GET"
):

will work fine in most cases, according to RFC6455 these values should be ASCII case-insensitive matches.

This does in fact lead to issues in practice when using matlab_proxy behind a reverse proxy where the reverse proxy may have rewritten Upgrade as upgrade (e.g. if you literally configured NGINX according to the instructions on https://nginx.org/en/docs/http/websocket.html). Of course the configuration can be changed such that the reverse proxy outputs Upgrade as well, but that should not be needed according to the RFC spec.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions