mirror of
https://github.com/django/daphne.git
synced 2024-11-21 23:46:33 +03:00
Only validate header names (values are already done)
This commit is contained in:
parent
b3c097aabd
commit
f046a35dbc
|
@ -45,9 +45,8 @@ def parse_x_forwarded_for(headers,
|
||||||
# Lowercase all header names in the dict
|
# Lowercase all header names in the dict
|
||||||
headers = {name.lower(): values for name, values in headers.items()}
|
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(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")
|
address_header_name = address_header_name.lower().encode("utf-8")
|
||||||
result = original
|
result = original
|
||||||
|
|
Loading…
Reference in New Issue
Block a user