From 7e93ee102c78cc9663e78f7188e3bb7298da009c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=2E=20K=C3=A4rkk=C3=A4inen?= Date: Sun, 1 Mar 2020 18:21:09 +0200 Subject: [PATCH] Typing --- sanic/asgi.py | 2 +- sanic/http.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sanic/asgi.py b/sanic/asgi.py index 3101a3de..52449819 100644 --- a/sanic/asgi.py +++ b/sanic/asgi.py @@ -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. """ diff --git a/sanic/http.py b/sanic/http.py index c659c3ca..646ab1e8 100644 --- a/sanic/http.py +++ b/sanic/http.py @@ -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."""