Skip to content

Use Chrome's extra info for headers and cookies - #166

Merged
soulgalore merged 1 commit into
mainfrom
fix-extra-info-headers-cookies
Nov 3, 2026
Merged

soulgalore merged 1 commit into
mainfrom
fix-extra-info-headers-cookies

Conversation

@soulgalore

Copy link
Copy Markdown
Member

Chrome sends the real network headers and cookies in separate extra info events. They were handled in a way that gave wrong HARs: headers were appended so the same header showed up twice with different case, response cookies set only in the extra info were missing, and extra info that arrived before the first page event (the normal order with Puppeteer) was dropped, so those requests lost their cookies and most headers.

When the server answered a revalidation with a 304, its few headers replaced the headers of the 200 that Chrome served from cache. That removed headers like content-type and content-encoding, which tools like the Coach use to check compression and caching.

Headers are now merged, with the extra info winning, and extra info for a response with another status is ignored. Timings, sizes and the number of pages and entries do not change.

Based on the first implementation and the test case by jtung23 in #111.

Assisted-by: Claude Opus 5.5 [email protected]

Chrome sends the real network headers and cookies in separate extra info events. They were handled in a way that gave wrong HARs: headers were appended so the same header showed up twice with different case, response cookies set only in the extra info were missing, and extra info that arrived before the first page event (the normal order with Puppeteer) was dropped, so those requests lost their cookies and most headers.

When the server answered a revalidation with a 304, its few headers replaced the headers of the 200 that Chrome served from cache. That removed headers like content-type and content-encoding, which tools like the Coach use to check compression and caching.

Headers are now merged, with the extra info winning, and extra info for a response with another status is ignored. Timings, sizes and the number of pages and entries do not change.

Based on the first implementation and the test case by jtung23 in #111.

Assisted-by: Claude Opus 5.5 [email protected]
@soulgalore
soulgalore merged commit 996cc6d into main Nov 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant