mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
Patch by Tim O'Malley for servers that send a response looking just like
HTTP/1.x 200
instead of
HTTP/1.x 200 OK
This commit is contained in:
parent
42e8e5d164
commit
29c4688659
1 changed files with 6 additions and 2 deletions
|
|
@ -123,8 +123,12 @@ def getreply(self):
|
|||
try:
|
||||
[ver, code, msg] = string.split(line, None, 2)
|
||||
except ValueError:
|
||||
self.headers = None
|
||||
return -1, line, self.headers
|
||||
try:
|
||||
[ver, code] = string.split(line, None, 1)
|
||||
msg = ""
|
||||
except ValueError:
|
||||
self.headers = None
|
||||
return -1, line, self.headers
|
||||
if ver[:5] != 'HTTP/':
|
||||
self.headers = None
|
||||
return -1, line, self.headers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue