Fix missingCompression, cookie Domain= casing, multi-TLD domain split…#129
Merged
Conversation
…, favicon default A handful of correctness fixes that surfaced in follow-up review. The most impactful: missingCompression has been over-counting since 4.0.0. headers.flatten wraps every value in an array, but the encoding check still compared the array to strings — so every large text asset, including fully gzipped ones, was reported as missing compression. The fix unwraps the array, accepts compound codings like "br, gzip", and recognises zstd. On the aftonbladet test HAR the count drops from 26 to 2. Third-party cookies set with lowercase "domain=" used to slip past the first/third-party check because the parser split on the literal string "Domain=". Cookie attribute names are case-insensitive (RFC 6265 §5.2), so domain= is now matched with a case-insensitive regex. getMainDomain only special-cased ".co.uk", so country sites like bbc.com.br collapsed to "com" and the auto-generated firstParty regex pulled in unrelated domains. Added the common two-label public suffixes (.co.jp, .com.br, .com.au, ...). A full Public Suffix List would be more correct but invasive. Two smaller consistency tweaks: favicon is now part of the default contentTypes shape so every page has the same fields (matching the README example), and xml joins the list of types flagged for missingCompression. Also dedupes the renderBlocking init literal that was sitting in two files. Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com
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.
…, favicon default
A handful of correctness fixes that surfaced in follow-up review.
The most impactful: missingCompression has been over-counting since 4.0.0. headers.flatten wraps every value in an array, but the encoding
check still compared the array to strings — so every large text asset, including fully gzipped ones, was reported as missing compression.
The fix unwraps the array, accepts compound codings like "br, gzip", and recognises zstd. On the aftonbladet test HAR the count drops from
26 to 2.
Third-party cookies set with lowercase "domain=" used to slip past the first/third-party check because the parser split on the literal
string "Domain=". Cookie attribute names are case-insensitive (RFC 6265 §5.2), so domain= is now matched with a case-insensitive regex.
getMainDomain only special-cased ".co.uk", so country sites like bbc.com.br collapsed to "com" and the auto-generated firstParty regex
pulled in unrelated domains. Added the common two-label public suffixes (.co.jp, .com.br, .com.au, ...). A full Public Suffix List would be
more correct but invasive.
Two smaller consistency tweaks: favicon is now part of the default contentTypes shape so every page has the same fields (matching the README
example), and xml joins the list of types flagged for missingCompression. Also dedupes the renderBlocking init literal that was sitting in
two files.
Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com