I'm trying to work on an app that communicates with my Samsung TV. After some digging I figured out that the missing status text causes it to not work.
def write_any_response(response, write):
if response.http_version != b"1.1":
raise LocalProtocolError("I only send HTTP/1.1")
status_bytes = str(response.status_code).encode("ascii")
# We don't bother sending ascii status messages like "OK"; they're
# optional and ignored by the protocol. (But the space after the numeric
# status code is mandatory.)
#
# XX FIXME: could at least make an effort to pull out the status message
# from stdlib's http.HTTPStatus table. Or maybe just steal their enums
# (either by import or copy/paste). We already accept them as status codes
# since they're of type IntEnum < int.
write(bytesmod(b"HTTP/1.1 %s %s\r\n", (status_bytes, response.reason)))
write_headers(response.headers, write)
Seeing as how there is a FIXME here already. Would it be possible to get the following added?
from http import HTTPStatus
response.reason = HTTPStatus(response.status_code).name.encode('ascii')
I'm trying to work on an app that communicates with my Samsung TV. After some digging I figured out that the missing status text causes it to not work.
Seeing as how there is a FIXME here already. Would it be possible to get the following added?