This commit is contained in:
Kovid Goyal 2015-05-17 18:41:56 +05:30
parent 656d0a1c10
commit 18a04ed23d

View File

@ -70,6 +70,9 @@ comma_separated_headers = {
b'WWW-Authenticate' b'WWW-Authenticate'
} }
decoded_headers = {
'Transfer-Encoding', 'Connection', 'Keep-Alive', 'Expect',
}
def read_headers(readline, max_line_size, hdict=None): # {{{ def read_headers(readline, max_line_size, hdict=None): # {{{
""" """
@ -118,7 +121,7 @@ def read_headers(readline, max_line_size, hdict=None): # {{{
try: try:
v = v.decode('ascii') v = v.decode('ascii')
except UnicodeDecodeError: except UnicodeDecodeError:
if hname in 'Transfer-Encoding Connection Keep-Alive Expect': if hname in decoded_headers:
raise raise
hdict[hname] = v hdict[hname] = v