Merge pull request #3734 from worldmind/master

Fix converting to HAR in case of void response
This commit is contained in:
Maximilian Hils 2019-12-05 13:40:25 +01:00 committed by GitHub
commit 1f91f5ce12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,8 +99,8 @@ def response(flow):
started_date_time = datetime.fromtimestamp(flow.request.timestamp_start, timezone.utc).isoformat() started_date_time = datetime.fromtimestamp(flow.request.timestamp_start, timezone.utc).isoformat()
# Response body size and encoding # Response body size and encoding
response_body_size = len(flow.response.raw_content) response_body_size = len(flow.response.raw_content) if flow.response.raw_content else 0
response_body_decoded_size = len(flow.response.content) response_body_decoded_size = len(flow.response.content) if flow.response.content else 0
response_body_compression = response_body_decoded_size - response_body_size response_body_compression = response_body_decoded_size - response_body_size
entry = { entry = {