Merge pull request #27 from mubix/patch-1

Case-insensitive content-type check
This commit is contained in:
lgandx 2014-02-10 16:58:02 -05:00
commit cff67bd4ba

View file

@ -1498,7 +1498,7 @@ def InjectData(data):
return Gzip return Gzip
else: else:
return data 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)) Len = ''.join(re.findall('(?<=Content-Length: )[^\r\n]*', Headers))
HasHTML = re.findall('(?<=<html)[^<]*', Content) HasHTML = re.findall('(?<=<html)[^<]*', Content)
if HasHTML : if HasHTML :