diff options
author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-05-29 11:03:54 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-05-29 11:03:54 +0200 |
commit | c707479bcd5a8ebb5d6bc8f54a5879176db46b3a (patch) | |
tree | 8fb49cb2bfa2f68b2841f2a4028c91eb781e4587 /examples/har_extractor.py | |
parent | 979c7fc319cbf551b9ea14062387f195b208b8fa (diff) | |
parent | 17382b963e22de8cb395a99e529b256e03d440ce (diff) | |
download | mitmproxy-c707479bcd5a8ebb5d6bc8f54a5879176db46b3a.tar.gz mitmproxy-c707479bcd5a8ebb5d6bc8f54a5879176db46b3a.tar.bz2 mitmproxy-c707479bcd5a8ebb5d6bc8f54a5879176db46b3a.zip |
Merge pull request #1173 from mitmproxy/format-examples
Format examples
Diffstat (limited to 'examples/har_extractor.py')
-rw-r--r-- | examples/har_extractor.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/har_extractor.py b/examples/har_extractor.py index 371e2282..6806989d 100644 --- a/examples/har_extractor.py +++ b/examples/har_extractor.py @@ -162,8 +162,11 @@ def response(context, flow): # If the current url is in the page list of context.HARLog or # does not have a referrer, we add it as a new pages object. - if (flow.request.url in context.HARLog.get_page_list() or - flow.request.headers.get('Referer') is None): + is_new_page = ( + flow.request.url in context.HARLog.get_page_list() or + flow.request.headers.get('Referer') is None + ) + if is_new_page: page_id = context.HARLog.create_page_id() context.HARLog.add( HAR.pages({ |