diff options
author | Shadab Zafar <dufferzafar0@gmail.com> | 2016-08-14 13:53:18 +0530 |
---|---|---|
committer | Shadab Zafar <dufferzafar0@gmail.com> | 2016-08-15 12:00:23 +0530 |
commit | bf4425de80dfa5a9b2bef2947e57a79f9655d74f (patch) | |
tree | e49d4c19be01e6d7a069bb2e19bea7971c671ed1 /examples | |
parent | 4f1fb43dcce262b3ade52d93f218538c1a64e4fd (diff) | |
download | mitmproxy-bf4425de80dfa5a9b2bef2947e57a79f9655d74f.tar.gz mitmproxy-bf4425de80dfa5a9b2bef2947e57a79f9655d74f.tar.bz2 mitmproxy-bf4425de80dfa5a9b2bef2947e57a79f9655d74f.zip |
Fix issue with binary content in json
Diffstat (limited to 'examples')
-rw-r--r-- | examples/har_dump.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/har_dump.py b/examples/har_dump.py index 803a3249..95090edb 100644 --- a/examples/har_dump.py +++ b/examples/har_dump.py @@ -130,10 +130,11 @@ def response(flow): # Store binay data as base64 if strutils.is_mostly_bin(flow.response.content): - entry["response"]["content"]["text"] = base64.b64encode(flow.response.content) + b64 = base64.b64encode(flow.response.content) + entry["response"]["content"]["text"] = b64.decode('ascii') entry["response"]["content"]["encoding"] = "base64" else: - entry["response"]["content"]["text"] = flow.response.content + entry["response"]["content"]["text"] = flow.response.text if flow.request.method in ["POST", "PUT", "PATCH"]: entry["request"]["postData"] = { |