mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
parent
67d6933ab5
commit
f899dfa1d1
2 changed files with 358 additions and 1 deletions
|
@ -218,6 +218,12 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
|
|||
# where each string is of the form name[/version].
|
||||
server_version = "BaseHTTP/" + __version__
|
||||
|
||||
# The default request version. This only affects responses up until
|
||||
# the point where the request line is parsed, so it mainly decides what
|
||||
# the client gets back when sending a malformed request line.
|
||||
# Most web servers default to HTTP 0.9, i.e. don't send a status line.
|
||||
default_request_version = "HTTP/0.9"
|
||||
|
||||
def parse_request(self):
|
||||
"""Parse a request (internal).
|
||||
|
||||
|
@ -230,7 +236,7 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
|
|||
|
||||
"""
|
||||
self.command = None # set in case of error on the first line
|
||||
self.request_version = version = "HTTP/0.9" # Default
|
||||
self.request_version = version = self.default_request_version
|
||||
self.close_connection = 1
|
||||
requestline = self.raw_requestline
|
||||
if requestline[-2:] == '\r\n':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue