Skip to content

Fix Wikipedia first-party regex and missing cookies on newline-joined#136

Merged
soulgalore merged 1 commit into
mainfrom
fix-firstparty-cookie-bugs
May 31, 2026
Merged

Fix Wikipedia first-party regex and missing cookies on newline-joined#136
soulgalore merged 1 commit into
mainfrom
fix-firstparty-cookie-bugs

Conversation

@soulgalore
Copy link
Copy Markdown
Member

Set-Cookie

The auto-derived first-party regex for Wikipedia pages contained a ||
where a single | was meant. The empty alternative between the two pipes
matched every string, so any third-party request (analytics, ads, CDNs)
on a Wikipedia page was wrongly classified as first-party and the
thirdParty bucket stayed empty. One-character fix in the regex, plus a
small regression test built from an inline HAR.

While in the area: getThirdPartyCookieNames was recently taught to stop
the Domain= capture at \n because some HARs concatenate multiple
Set-Cookie response headers into one value joined by newlines. Its
sister getCookieNames still split only on the first = and therefore
silently dropped every cookie after the first in such a joined block,
under-reporting page.cookies and page.cookieNames. Apply the same
newline split there so both functions agree on the format.

Co-authored-by: Claude noreply@anthropic.com

  Set-Cookie

  The auto-derived first-party regex for Wikipedia pages contained a ||
  where a single | was meant. The empty alternative between the two pipes
  matched every string, so any third-party request (analytics, ads, CDNs)
  on a Wikipedia page was wrongly classified as first-party and the
  thirdParty bucket stayed empty. One-character fix in the regex, plus a
  small regression test built from an inline HAR.

  While in the area: getThirdPartyCookieNames was recently taught to stop
  the Domain= capture at \n because some HARs concatenate multiple
  Set-Cookie response headers into one value joined by newlines. Its
  sister getCookieNames still split only on the first = and therefore
  silently dropped every cookie after the first in such a joined block,
  under-reporting page.cookies and page.cookieNames. Apply the same
  newline split there so both functions agree on the format.

  Co-authored-by: Claude noreply@anthropic.com
@soulgalore soulgalore merged commit d89c4c0 into main May 31, 2026
2 checks passed
@soulgalore soulgalore deleted the fix-firstparty-cookie-bugs branch May 31, 2026 15:10
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