vinissimus / async-asgi-testclient

A framework-agnostic library for testing ASGI web applications
MIT License
159 stars 20 forks source link

WebSocket connection scope's subprotocols not properly constructed #39

Open villekr opened 3 years ago

villekr commented 3 years ago

https://asgi.readthedocs.io/en/latest/specs/www.html#websocket-connection-scope

"subprotocols" key should be built from Sec-WebSocket-Protocol header value. Currently it's always empty.

        scope = {
            "type": "websocket",
            "headers": flatten_headers(headers),
            "path": path,
            "query_string": query_string_bytes,
            "root_path": "",
            "scheme": "http",
            "subprotocols": [],
        }