aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/contentviews.py
diff options
context:
space:
mode:
Diffstat (limited to 'mitmproxy/contentviews.py')
-rw-r--r--mitmproxy/contentviews.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/mitmproxy/contentviews.py b/mitmproxy/contentviews.py
index 331a706f..afdaad7f 100644
--- a/mitmproxy/contentviews.py
+++ b/mitmproxy/contentviews.py
@@ -31,7 +31,6 @@ from six import BytesIO
from mitmproxy import exceptions
from mitmproxy.contrib import jsbeautifier
from mitmproxy.contrib.wbxml import ASCommandResponse
-from netlib import encoding
from netlib import http
from netlib import multidict
from netlib.http import url
@@ -620,15 +619,6 @@ def get_content_view(viewmode, data, **metadata):
Raises:
ContentViewException, if the content view threw an error.
"""
- msg = []
-
- headers = metadata.get("headers", {})
- enc = headers.get("content-encoding")
- if enc and enc != "identity":
- decoded = encoding.decode(enc, data)
- if decoded:
- data = decoded
- msg.append("[decoded %s]" % enc)
try:
ret = viewmode(data, **metadata)
# Third-party viewers can fail in unexpected ways...
@@ -639,8 +629,8 @@ def get_content_view(viewmode, data, **metadata):
sys.exc_info()[2]
)
if not ret:
- ret = get("Raw")(data, **metadata)
- msg.append("Couldn't parse: falling back to Raw")
+ desc = "Couldn't parse: falling back to Raw"
+ _, content = get("Raw")(data, **metadata)
else:
- msg.append(ret[0])
- return " ".join(msg), safe_to_print(ret[1])
+ desc, content = ret
+ return desc, safe_to_print(content)