Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
811fc149
Commit
811fc149
authored
Aug 03, 2007
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix status line parsing for http response.
parent
4737482f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
Lib/httplib.py
Lib/httplib.py
+7
-2
No files found.
Lib/httplib.py
View file @
811fc149
...
...
@@ -264,7 +264,7 @@ class HTTPMessage(mimetools.Message):
except
IOError
:
startofline
=
tell
=
None
self
.
seekable
=
0
line
=
s
elf
.
fp
.
readline
(
)
line
=
s
tr
(
self
.
fp
.
readline
(),
"iso-8859-1"
)
if
not
line
:
self
.
status
=
'EOF in headers'
break
...
...
@@ -317,6 +317,11 @@ class HTTPResponse:
# See RFC 2616 sec 19.6 and RFC 1945 sec 6 for details.
# The bytes from the socket object are iso-8859-1 strings.
# See RFC 2616 sec 2.2 which notes an exception for MIME-encoded
# text following RFC 2047. The basic status line parsing only
# accepts iso-8859-1.
def
__init__
(
self
,
sock
,
debuglevel
=
0
,
strict
=
0
,
method
=
None
):
self
.
fp
=
sock
.
makefile
(
'rb'
,
0
)
self
.
debuglevel
=
debuglevel
...
...
@@ -337,7 +342,7 @@ class HTTPResponse:
def
_read_status
(
self
):
# Initialize with Simple-Response defaults
line
=
s
elf
.
fp
.
readline
(
)
line
=
s
tr
(
self
.
fp
.
readline
(),
"iso-8859-1"
)
if
self
.
debuglevel
>
0
:
print
(
"reply:"
,
repr
(
line
))
if
not
line
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment