aboutsummaryrefslogtreecommitdiffstats
path: root/examples/complex/har_dump.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/complex/har_dump.py')
-rw-r--r--examples/complex/har_dump.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/complex/har_dump.py b/examples/complex/har_dump.py
index 9e287a19..040c7d28 100644
--- a/examples/complex/har_dump.py
+++ b/examples/complex/har_dump.py
@@ -20,11 +20,11 @@ from mitmproxy import ctx
from mitmproxy.utils import strutils
from mitmproxy.net.http import cookies
-HAR = {} # type: typing.Dict
+HAR: typing.Dict = {}
# A list of server seen till now is maintained so we can avoid
# using 'connect' time for entries that use an existing connection.
-SERVERS_SEEN = set() # type: typing.Set[connections.ServerConnection]
+SERVERS_SEEN: typing.Set[connections.ServerConnection] = set()
def load(l):
@@ -155,12 +155,12 @@ def done():
Called once on script shutdown, after any other events.
"""
if ctx.options.hardump:
- json_dump = json.dumps(HAR, indent=2) # type: str
+ json_dump: str = json.dumps(HAR, indent=2)
if ctx.options.hardump == '-':
mitmproxy.ctx.log(json_dump)
else:
- raw = json_dump.encode() # type: bytes
+ raw: bytes = json_dump.encode()
if ctx.options.hardump.endswith('.zhar'):
raw = zlib.compress(raw, 9)