Repository navigation
Use Chrome's extra info for headers and cookies - #166
Merged
Merged
Conversation
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]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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]