Merge pull request #43 from txgio/case-insensitive-headers
Making the incoming headers case insensitive.
This commit is contained in:
commit
0925557d9f
@ -180,10 +180,10 @@ class AjaxClient:
|
|||||||
headers = {}
|
headers = {}
|
||||||
for line in parts[0].split(makeBytes('\r\n')):
|
for line in parts[0].split(makeBytes('\r\n')):
|
||||||
pair = line.split(makeBytes(': '))
|
pair = line.split(makeBytes(': '))
|
||||||
headers[pair[0]] = pair[1] if len(pair) > 1 else None
|
headers[pair[0].lower()] = pair[1] if len(pair) > 1 else None
|
||||||
|
|
||||||
headerLength = len(parts[0]) + 4
|
headerLength = len(parts[0]) + 4
|
||||||
bodyLength = int(headers.get(makeBytes('Content-Length'), 0))
|
bodyLength = int(headers.get(makeBytes('content-length'), 0))
|
||||||
totalLength = headerLength + bodyLength
|
totalLength = headerLength + bodyLength
|
||||||
|
|
||||||
if totalLength > len(data):
|
if totalLength > len(data):
|
||||||
|
Loading…
Reference in New Issue
Block a user