Case-insensitive content-type check

Was noticing that injection wasn't happening when the header was "Content-type" instead of the checked for "Content-Type". Headers could probably be put as .lower() from the beginning, but then again there might be header content that may break because of it.
This commit is contained in:
Rob Fuller 2014-02-10 16:55:11 -05:00
parent 2c9273eb2c
commit 094824bfd3

View file

@ -1498,7 +1498,7 @@ def InjectData(data):
return Gzip
else:
return data
if "Content-Type: text/html" in Headers:
if "content-type: text/html" in Headers.lower():
Len = ''.join(re.findall('(?<=Content-Length: )[^\r\n]*', Headers))
HasHTML = re.findall('(?<=<html)[^<]*', Content)
if HasHTML :