diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-05-29 01:23:39 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-05-29 01:23:39 -0700 |
commit | 17382b963e22de8cb395a99e529b256e03d440ce (patch) | |
tree | bad14d80e1580995be2fc48780669bba747b8552 /examples/har_extractor.py | |
parent | 8638000cfa859ca2ae5fb39c58cbdf5e6fc10c19 (diff) | |
download | mitmproxy-17382b963e22de8cb395a99e529b256e03d440ce.tar.gz mitmproxy-17382b963e22de8cb395a99e529b256e03d440ce.tar.bz2 mitmproxy-17382b963e22de8cb395a99e529b256e03d440ce.zip |
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({ |