aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy
diff options
context:
space:
mode:
authordufferzafar <dufferzafar0@gmail.com>2016-07-28 07:48:10 -0700
committerdufferzafar <dufferzafar0@gmail.com>2016-07-28 07:48:10 -0700
commit1cffa5f46b84928f1dd211806122d01700345b40 (patch)
tree8b48e4a93af6f3037ec0454c53c6ba3b4028e8cb /mitmproxy
parent56d04b57401cbdaea771f0b77bbbc5ffc111d5c7 (diff)
downloadmitmproxy-1cffa5f46b84928f1dd211806122d01700345b40.tar.gz
mitmproxy-1cffa5f46b84928f1dd211806122d01700345b40.tar.bz2
mitmproxy-1cffa5f46b84928f1dd211806122d01700345b40.zip
Use replace while decoding
Diffstat (limited to 'mitmproxy')
-rw-r--r--mitmproxy/contentviews.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mitmproxy/contentviews.py b/mitmproxy/contentviews.py
index 304b5241..dacef36d 100644
--- a/mitmproxy/contentviews.py
+++ b/mitmproxy/contentviews.py
@@ -262,7 +262,7 @@ class ViewHTMLOutline(View):
content_types = ["text/html"]
def __call__(self, data, **metadata):
- data = data.decode("utf-8")
+ data = data.decode("utf-8", "replace")
h = html2text.HTML2Text(baseurl="")
h.ignore_images = True
h.body_width = 0
@@ -389,7 +389,8 @@ class ViewJavaScript(View):
def __call__(self, data, **metadata):
opts = jsbeautifier.default_options()
opts.indent_size = 2
- res = jsbeautifier.beautify(strutils.native(data), opts)
+ data = data.decode("utf-8", "replace")
+ res = jsbeautifier.beautify(data, opts)
return "JavaScript", format_text(res)