mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
Fix divide by zero issue when timestamp start and end are the same
This commit is contained in:
parent
f63380a04e
commit
9a986e0c1b
@ -190,7 +190,7 @@ def format_flow(f, focus, extended=False, hostheader=False, padding=2):
|
|||||||
|
|
||||||
delta = f.response.timestamp_end - f.response.timestamp_start
|
delta = f.response.timestamp_end - f.response.timestamp_start
|
||||||
size = len(f.response.content) + f.response.get_header_size()
|
size = len(f.response.content) + f.response.get_header_size()
|
||||||
rate = utils.pretty_size(size / delta)
|
rate = utils.pretty_size(size / ( delta if delta > 0 else 1 ) )
|
||||||
|
|
||||||
d.update(dict(
|
d.update(dict(
|
||||||
resp_code = f.response.code,
|
resp_code = f.response.code,
|
||||||
|
Loading…
Reference in New Issue
Block a user