Skip to content

Include scheme on WebSocket ASGI scopes - #589

Open
gyanu2507 wants to merge 1 commit into
django:mainfrom
gyanu2507:websocket-scope-scheme
Open

gyanu2507 wants to merge 1 commit into
django:mainfrom
gyanu2507:websocket-scope-scheme

Conversation

@gyanu2507

Copy link
Copy Markdown

HTTP scopes already had scheme. The WebSocket upgrade path never copied it, so Quart (and anything else that indexes scope['scheme']) died with KeyError even though the spec default is ws.

The value now comes from TLS on the HTTP connection, mapped to ws/wss, and X-Forwarded-Proto still wins when proxy headers are enabled.

Fixes #538

HTTP scopes already had it; the upgrade path dropped it, so Quart and
anything that reads scope['scheme'] blew up. Carry ws/wss through TLS
and X-Forwarded-Proto.
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

Successfully merging this pull request may close these issues.

Missing 'scheme' key in ws scope

1 participant