Skip to content

cookie: trim trailing dots when checking PSL#21636

Closed
bagder wants to merge 2 commits into
masterfrom
bagder/cookie-domain-traildot
Closed

cookie: trim trailing dots when checking PSL#21636
bagder wants to merge 2 commits into
masterfrom
bagder/cookie-domain-traildot

Conversation

@bagder
Copy link
Copy Markdown
Member

@bagder bagder commented May 15, 2026

Verified with test 1629

@bagder bagder marked this pull request as ready for review May 15, 2026 22:38
@bagder bagder requested a review from Copilot May 15, 2026 22:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts cookie Public Suffix List (PSL) handling so domain comparisons ignore a trailing dot, and adds a regression test to cover cookies set for a PSL domain with a trailing dot.

Changes:

  • Trim a single trailing . from the request host and cookie Domain before performing the libpsl acceptability check.
  • Add a new test (1629) for cookies using Domain=co.uk. and hosts like foo.co.uk..
  • Register the new test in the tests data makefile.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/data/test1629 Adds a regression test for cookie + PSL behavior with trailing-dot domains/hosts.
tests/data/Makefile.am Includes the new test1629 in the test data list.
lib/cookie.c Normalizes trailing-dot domains before calling libpsl cookie acceptability checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/data/test1629
@bagder bagder closed this in 51beed1 May 16, 2026
@bagder bagder deleted the bagder/cookie-domain-traildot branch May 16, 2026 09:24
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants