Skip to content

Commit 7bc5c32

Browse files
committed
Cleanup invalid HAR pageTimings data
1 parent 43a449a commit 7bc5c32

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/model/http/har.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,14 @@ function cleanRawHarData(harContents: any) {
528528
});
529529

530530
const pages = harContents?.log?.pages ?? [];
531-
pages.forEach((page: any) => {
531+
pages.forEach((page: HarFormat.Page) => {
532532
// FF doesn't give pages their (required) titles:
533533
if (page.title === undefined) page.title = page.id;
534+
535+
// All timings fields are optional, but some sources provide 'null' values (instead of -1)
536+
// to mark missing data, which isn't valid. Fortunately, we never use this data, so we can
537+
// just drop it entirely:
538+
page.pageTimings = {};
534539
});
535540

536541
return harContents;

0 commit comments

Comments
 (0)