From b0092cb09ef66d8787c934f0db524bac4014d27e Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Sat, 20 Jan 2024 15:00:03 +0100 Subject: [PATCH] Bump ASGI spec version to 2.4 (#2221) --- uvicorn/protocols/websockets/websockets_impl.py | 2 +- uvicorn/protocols/websockets/wsproto_impl.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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,