prevent crash for unknown response codes
set text for unknown status code, otherwise when None is used exception occurs.
This commit is contained in:
parent
28bd09a2ea
commit
ff0632001c
|
@ -210,7 +210,7 @@ class HTTPResponse(BaseHTTPResponse):
|
|||
# Speeds up response rate 6% over pulling from all
|
||||
status = COMMON_STATUS_CODES.get(self.status)
|
||||
if not status:
|
||||
status = ALL_STATUS_CODES.get(self.status)
|
||||
status = ALL_STATUS_CODES.get(self.status, b'UNKNOWN RESPONSE')
|
||||
|
||||
return (b'HTTP/%b %d %b\r\n'
|
||||
b'Connection: %b\r\n'
|
||||
|
|
Loading…
Reference in New Issue
Block a user