mirror of
https://github.com/django/daphne.git
synced 2024-11-26 01:33:44 +03:00
fix check for x-forwarded-for header for WS connections
This commit is contained in:
parent
bd03fabce6
commit
ccaa7eda3e
|
@ -27,6 +27,9 @@ def parse_x_forwarded_for(headers,
|
|||
# Convert twisted-style headers into dicts
|
||||
if isinstance(headers, Headers):
|
||||
headers = dict(headers.getAllRawHeaders())
|
||||
else:
|
||||
# convert non twisted headers dict into utf-8
|
||||
headers = {name.encode("utf-8"): values.encode("utf-8") for name, values in headers.items()}
|
||||
|
||||
# Lowercase all header names in the dict
|
||||
headers = {name.lower(): values for name, values in headers.items()}
|
||||
|
|
Loading…
Reference in New Issue
Block a user