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 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. Read and stream the body in chunks from an incoming ASGI message.
""" """

View File

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