File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,12 +65,17 @@ def canon_x_duo_headers(additional_headers):
6565 if additional_headers is None :
6666 additional_headers = {}
6767
68+ # Lower the headers before sorting them
69+ lowered_headers = {}
70+ for header_name , header_value in additional_headers .items ():
71+ header_name = header_name .lower () if header_name is not None else None
72+ lowered_headers [header_name ] = header_value
73+
6874 canon_list = []
6975 added_headers = [] # store headers we've added, use for duplicate checking (case insensitive)
70- for header_name in sorted (additional_headers .keys ()):
76+ for header_name in sorted (lowered_headers .keys ()):
7177 # Extract header value and set key to lower case from now on.
72- value = additional_headers [header_name ]
73- header_name = header_name .lower () if header_name is not None else None
78+ value = lowered_headers [header_name ]
7479
7580 # Validation gate. We will raise if a problem is found here.
7681 _validate_additional_header (header_name , value , added_headers )
You can’t perform that action at this time.
0 commit comments