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
883de5fb
Commit
883de5fb
authored
Aug 10, 2007
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow rfc822 to process headers from an incoming HTTP request.
parent
f27426ab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
Lib/BaseHTTPServer.py
Lib/BaseHTTPServer.py
+8
-1
No files found.
Lib/BaseHTTPServer.py
View file @
883de5fb
...
...
@@ -70,6 +70,7 @@ __version__ = "0.3"
__all__
=
[
"HTTPServer"
,
"BaseHTTPRequestHandler"
]
import
io
import
sys
import
time
import
socket
# For gethostbyaddr()
...
...
@@ -278,7 +279,13 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
self
.
command
,
self
.
path
,
self
.
request_version
=
command
,
path
,
version
# Examine the headers and look for a Connection directive
self
.
headers
=
self
.
MessageClass
(
self
.
rfile
,
0
)
# MessageClass == rfc822 expects ascii, so use a text wrapper.
text
=
io
.
TextIOWrapper
(
self
.
rfile
)
self
.
headers
=
self
.
MessageClass
(
text
,
0
)
# The text wrapper does buffering (as does self.rfile). We
# don't want to leave any data in the buffer of the text
# wrapper.
assert
not
text
.
buffer
.
peek
()
conntype
=
self
.
headers
.
get
(
'Connection'
,
""
)
if
conntype
.
lower
()
==
'close'
:
...
...
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