SF patch #405845 by Martin von Löwis
Fixes SF bug #405427. If an http response has a bogus return code, e.g. 400.100, raise BadStatusLine.
This commit is contained in:
parent
3bee2f6011
commit
23d4047790
|
@ -126,7 +126,13 @@ class HTTPResponse:
|
|||
self.close()
|
||||
raise BadStatusLine(line)
|
||||
|
||||
self.status = status = int(status)
|
||||
# The status code is a three-digit number
|
||||
try:
|
||||
self.status = status = int(status)
|
||||
if status < 100 or status > 999:
|
||||
raise BadStatusLine(line)
|
||||
except ValueError:
|
||||
raise BadStatusLine(line)
|
||||
self.reason = reason.strip()
|
||||
|
||||
if version == 'HTTP/1.0':
|
||||
|
|
Loading…
Reference in New Issue