Only validate header names (values are already done)

This commit is contained in:
Andrew Godwin 2018-05-24 12:43:18 +02:00 committed by Andrew Godwin
parent b3c097aabd
commit f046a35dbc

View File

@ -45,9 +45,8 @@ def parse_x_forwarded_for(headers,
# Lowercase all header names in the dict
headers = {name.lower(): values for name, values in headers.items()}
# Make sure header names and values are bytes
# Make sure header names are bytes (values are checked in header_value)
assert all(isinstance(name, bytes) for name in headers.keys())
assert all(isinstance(value, bytes) for value in headers.values())
address_header_name = address_header_name.lower().encode("utf-8")
result = original