mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Normalize the encoding names for Latin-1 and UTF-8 to
'latin-1' and 'utf-8'. These are optimized in the Python Unicode implementation to result in more direct processing, bypassing the codec registry. Also see issue11303.
This commit is contained in:
parent
a391b11320
commit
8f36af7a4c
32 changed files with 84 additions and 79 deletions
|
|
@ -448,7 +448,7 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
|
|||
message = ''
|
||||
if self.request_version != 'HTTP/0.9':
|
||||
self.wfile.write(("%s %d %s\r\n" %
|
||||
(self.protocol_version, code, message)).encode('latin1', 'strict'))
|
||||
(self.protocol_version, code, message)).encode('latin-1', 'strict'))
|
||||
|
||||
def send_header(self, keyword, value):
|
||||
"""Send a MIME header."""
|
||||
|
|
@ -456,7 +456,7 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
|
|||
if not hasattr(self, '_headers_buffer'):
|
||||
self._headers_buffer = []
|
||||
self._headers_buffer.append(
|
||||
("%s: %s\r\n" % (keyword, value)).encode('latin1', 'strict'))
|
||||
("%s: %s\r\n" % (keyword, value)).encode('latin-1', 'strict'))
|
||||
|
||||
if keyword.lower() == 'connection':
|
||||
if value.lower() == 'close':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue