Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit a67d3cb

Browse files
committed
har dump none har fix
1 parent 04f9ebc commit a67d3cb

File tree

1 file changed

+7
-3
lines changed
  • browserup-proxy-core/src/main/resources/mitmproxy

1 file changed

+7
-3
lines changed

browserup-proxy-core/src/main/resources/mitmproxy/har_dump.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ def get_or_create_default_page(self):
387387
return default_page
388388

389389
def add_default_page(self):
390+
self.get_or_create_har(DEFAULT_PAGE_REF, DEFAULT_PAGE_TITLE, False)
390391
new_page = self.generate_new_har_page()
391392
new_page['title'] = DEFAULT_PAGE_REF
392393
new_page['startedDateTime'] = datetime.utcnow().isoformat()
@@ -401,9 +402,12 @@ def get_default_page(self):
401402
return None
402403

403404
def new_har(self, initial_page_ref, initial_page_title, create_page=False):
404-
ctx.log.info(
405-
'Creating new har with initial page ref: {}, title: {}'.
406-
format(initial_page_ref, initial_page_title))
405+
if create_page:
406+
ctx.log.info(
407+
'Creating new har with initial page ref: {}, title: {}'.
408+
format(initial_page_ref, initial_page_title))
409+
else:
410+
ctx.log.info('Creating new har without initial page')
407411

408412
old_har = self.end_har()
409413

0 commit comments

Comments
 (0)