Skip to content

Commit 1920297

Browse files
authored
Update zttp to 0.0.22 (#3063)
1 parent 5c560da commit 1920297

4 files changed

Lines changed: 90 additions & 68 deletions

File tree

‎pyproject.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ dev = [
7070
# Explicit optionals,
7171
"a2wsgi==1.10.10",
7272
"wsproto==1.3.2",
73-
"zttp==0.0.20; python_version >= '3.12'",
73+
"zttp==0.0.22; python_version >= '3.12'",
7474
]
7575
docs = [
7676
"zensical==0.0.43",
@@ -84,7 +84,7 @@ exclude-newer = "7 days"
8484

8585
[tool.uv.exclude-newer-package]
8686
httptools = "2026-05-26"
87-
zttp = "2026-07-28"
87+
zttp = "2026-08-13"
8888

8989
[project.scripts]
9090
uvicorn = "uvicorn.main:main"

‎tests/protocols/test_http.py‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from tests.response import Response
1414
from uvicorn import Server
15-
from uvicorn._types import ASGIApplication, ASGIReceiveCallable, ASGISendCallable, Scope
15+
from uvicorn._types import ASGIApplication, ASGIReceiveCallable, ASGIReceiveEvent, ASGISendCallable, Scope
1616
from uvicorn.config import WS_PROTOCOLS, Config
1717
from uvicorn.lifespan.off import LifespanOff
1818
from uvicorn.lifespan.on import LifespanOn
@@ -387,6 +387,22 @@ async def app(scope: Scope, receive: ASGIReceiveCallable, send: ASGISendCallable
387387
assert b'Body: {"hello": "world"}' in protocol.transport.buffer
388388

389389

390+
async def test_bodyless_request_receive(http_protocol_cls: type[HTTPProtocol]):
391+
request_message: ASGIReceiveEvent | None = None
392+
393+
async def app(scope: Scope, receive: ASGIReceiveCallable, send: ASGISendCallable):
394+
nonlocal request_message
395+
request_message = await receive()
396+
response = Response(b"", status_code=204)
397+
await response(scope, receive, send)
398+
399+
protocol = get_connected_protocol(app, http_protocol_cls)
400+
protocol.data_received(SIMPLE_GET_REQUEST)
401+
await protocol.loop.run_one()
402+
403+
assert request_message == {"type": "http.request", "body": b"", "more_body": False}
404+
405+
390406
async def test_keepalive(http_protocol_cls: type[HTTPProtocol]):
391407
app = Response(b"", status_code=204)
392408

0 commit comments

Comments
 (0)