Skip to content

Commit fc6c51b

Browse files
authored
Drop ASGI spec version to 2.3 on HTTP (#2513)
1 parent 2aea835 commit fc6c51b

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

tests/protocols/test_http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,8 @@ async def asgi(receive: ASGIReceiveCallable, send: ASGISendCallable):
860860
@pytest.mark.parametrize(
861861
"asgi2or3_app, expected_scopes",
862862
[
863-
(asgi3app, {"version": "3.0", "spec_version": "2.4"}),
864-
(asgi2app, {"version": "2.0", "spec_version": "2.4"}),
863+
(asgi3app, {"version": "3.0", "spec_version": "2.3"}),
864+
(asgi2app, {"version": "2.0", "spec_version": "2.3"}),
865865
],
866866
)
867867
async def test_scopes(

uvicorn/protocols/http/h11_impl.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,7 @@ def handle_events(self) -> None:
200200
full_raw_path = self.root_path.encode("ascii") + raw_path
201201
self.scope = {
202202
"type": "http",
203-
"asgi": {
204-
"version": self.config.asgi_version,
205-
"spec_version": "2.4",
206-
},
203+
"asgi": {"version": self.config.asgi_version, "spec_version": "2.3"},
207204
"http_version": event.http_version.decode("ascii"),
208205
"server": self.server,
209206
"client": self.client,

uvicorn/protocols/http/httptools_impl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def on_message_begin(self) -> None:
222222
self.headers = []
223223
self.scope = { # type: ignore[typeddict-item]
224224
"type": "http",
225-
"asgi": {"version": self.config.asgi_version, "spec_version": "2.4"},
225+
"asgi": {"version": self.config.asgi_version, "spec_version": "2.3"},
226226
"http_version": "1.1",
227227
"server": self.server,
228228
"client": self.client,

0 commit comments

Comments
 (0)