diff options
author | Shrub, Aliaksei <Aliaksei.Shrub@wolterskluwer.com> | 2019-11-29 10:08:19 +0300 |
---|---|---|
committer | Shrub, Aliaksei <Aliaksei.Shrub@wolterskluwer.com> | 2019-11-29 10:08:19 +0300 |
commit | 6e1cf3307173c3935e18250da24386bab99213a8 (patch) | |
tree | 8bf4e5e8ce9bbe00d187d4f9d053aecc96dd7954 /examples | |
parent | f026285434a3800eef4284ff2d662d4d0c9a2d84 (diff) | |
download | mitmproxy-6e1cf3307173c3935e18250da24386bab99213a8.tar.gz mitmproxy-6e1cf3307173c3935e18250da24386bab99213a8.tar.bz2 mitmproxy-6e1cf3307173c3935e18250da24386bab99213a8.zip |
Fix converting to HAR in case of void response
Diffstat (limited to 'examples')
-rw-r--r-- | examples/complex/har_dump.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/complex/har_dump.py b/examples/complex/har_dump.py index e3cea9fd..8f46ee0d 100644 --- a/examples/complex/har_dump.py +++ b/examples/complex/har_dump.py @@ -99,8 +99,8 @@ def response(flow): started_date_time = datetime.fromtimestamp(flow.request.timestamp_start, timezone.utc).isoformat() # Response body size and encoding - response_body_size = len(flow.response.raw_content) - response_body_decoded_size = len(flow.response.content) + response_body_size = len(flow.response.raw_content) if flow.response.raw_content else 0 + response_body_decoded_size = len(flow.response.content) if flow.response.content else 0 response_body_compression = response_body_decoded_size - response_body_size entry = { |