diff --git a/uvicorn/protocols/websockets/websockets_impl.py b/uvicorn/protocols/websockets/websockets_impl.py index 0c015991a..9aab66759 100644 --- a/uvicorn/protocols/websockets/websockets_impl.py +++ b/uvicorn/protocols/websockets/websockets_impl.py @@ -191,7 +191,7 @@ async def process_request( self.scope = { "type": "websocket", - "asgi": {"version": self.config.asgi_version, "spec_version": "2.3"}, + "asgi": {"version": self.config.asgi_version, "spec_version": "2.4"}, "http_version": "1.1", "scheme": self.scheme, "server": self.server, diff --git a/uvicorn/protocols/websockets/wsproto_impl.py b/uvicorn/protocols/websockets/wsproto_impl.py index a9bcf7879..85880a408 100644 --- a/uvicorn/protocols/websockets/wsproto_impl.py +++ b/uvicorn/protocols/websockets/wsproto_impl.py @@ -170,7 +170,7 @@ def handle_connect(self, event: events.Request) -> None: full_raw_path = self.root_path.encode("ascii") + raw_path.encode("ascii") self.scope: "WebSocketScope" = { "type": "websocket", - "asgi": {"version": self.config.asgi_version, "spec_version": "2.3"}, + "asgi": {"version": self.config.asgi_version, "spec_version": "2.4"}, "http_version": "1.1", "scheme": self.scheme, "server": self.server,