diff options
author | Maximilian Hils <git@maximilianhils.com> | 2019-12-05 13:40:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-05 13:40:25 +0100 |
commit | 1f91f5ce12a234d8c9bb441fae42689399e6ce8e (patch) | |
tree | 412e81b011e86adf24803e8c887709edb9c5998e | |
parent | 0b86d65b61ce3402691a7a4a7616e4fd3f9b29aa (diff) | |
parent | 6e1cf3307173c3935e18250da24386bab99213a8 (diff) | |
download | mitmproxy-1f91f5ce12a234d8c9bb441fae42689399e6ce8e.tar.gz mitmproxy-1f91f5ce12a234d8c9bb441fae42689399e6ce8e.tar.bz2 mitmproxy-1f91f5ce12a234d8c9bb441fae42689399e6ce8e.zip |
Merge pull request #3734 from worldmind/master
Fix converting to HAR in case of void response
-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 = { |