Fix returning data, check mime to avoid heavy chardet process we are not interested in other mimes.

This commit is contained in:
HAMIDx9 2016-01-29 01:42:54 +03:30
parent 2490b87f43
commit f8293c38c9

View file

@ -64,7 +64,10 @@ class Inject(Plugin):
try:
mime = response.headers['Content-Type']
except KeyError:
return
return {'response': response, 'request':request, 'data': data}
if "text/html" not in mime:
return {'response': response, 'request':request, 'data': data}
if "charset" in mime:
match = re.search('charset=(.*)', mime)