This commit is contained in:
L. Kärkkäinen 2020-03-01 18:21:09 +02:00
parent 08353637fd
commit 7e93ee102c
2 changed files with 2 additions and 2 deletions

View File

@ -255,7 +255,7 @@ class ASGIApp:
return instance
async def read(self) -> None:
async def read(self) -> Optional[bytes]:
"""
Read and stream the body in chunks from an incoming ASGI message.
"""

View File

@ -248,7 +248,7 @@ class Http:
if size:
return b"%x\r\n%b\r\n0\r\n\r\n" % (size, data)
return b"0\r\n\r\n"
return b"%x\r\n%b\r\n" % (size, data) if size else None
return b"%x\r\n%b\r\n" % (size, data) if size else b""
def http1_response_normal(self, data: bytes, end_stream: bool) -> bytes:
"""Format / keep track of non-chunked response."""