Workaround MyPy issue.

This commit is contained in:
L. Kärkkäinen 2019-12-15 14:05:48 +02:00
parent 347fd96e72
commit 6cfd764084

View File

@ -190,12 +190,12 @@ def format_http1_response(
- If `body` is included, content-length must be specified in headers.
"""
headers = format_http1(headers)
headerbytes = format_http1(headers)
if status == 200:
return b"HTTP/1.1 200 OK\r\n%b\r\n%b" % (headers, body)
return b"HTTP/1.1 200 OK\r\n%b\r\n%b" % (headerbytes, body)
return b"HTTP/1.1 %d %b\r\n%b\r\n%b" % (
status,
STATUS_CODES.get(status, b"UNKNOWN"),
headers,
headerbytes,
body,
)