From f046a35dbc315948a52b9937ece95f69ef83f51c Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Thu, 24 May 2018 12:43:18 +0200 Subject: [PATCH] Only validate header names (values are already done) --- daphne/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/daphne/utils.py b/daphne/utils.py index 6c173ea..cd9e86e 100644 --- a/daphne/utils.py +++ b/daphne/utils.py @@ -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