From f8293c38c946372fb488914df19264635fae3ee1 Mon Sep 17 00:00:00 2001 From: HAMIDx9 Date: Fri, 29 Jan 2016 01:42:54 +0330 Subject: [PATCH] Fix returning data, check mime to avoid heavy chardet process we are not interested in other mimes. --- plugins/inject.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/inject.py b/plugins/inject.py index 27bda03..bc7ca9c 100644 --- a/plugins/inject.py +++ b/plugins/inject.py @@ -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)