and trailing whitespace around header values instead of just a single
space. Such whitespace is legal but appears to be uncommon (and nginx
apparently normalizes everything to a single space)
http://tools.ietf.org/html/rfc2616#page-31
return
if header_line == "\r\n":
return
- parts = header_line.split(": ")
+ parts = header_line.split(":")
if len(parts) != 2:
_log.warning("Invalid HTTP response header line %r", header_line)
return
headers = cls()
for line in headers_string.splitlines():
if line:
- name, value = line.split(": ", 1)
- headers[name] = value
+ name, value = line.split(":", 1)
+ headers[name] = value.strip()
return headers
headers = cls()
for line in headers_string.splitlines():
if line:
- name, value = line.split(": ", 1)
- headers[name] = value
+ name, value = line.split(":", 1)
+ headers[name] = value.strip()
return headers