Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore leading dot when merging cookies #329

Merged
merged 3 commits into from
Feb 2, 2023

Conversation

stevecrozz
Copy link
Contributor

Most recent specification states that leading dots are ignored by user agents: https://httpwg.org/specs/rfc6265.html#sane-domain

Rails in particular likes to add a leading dot: https://github.com/rails/rails/blob/main/actionpack/lib/action_dispatch/middleware/cookies.rb#L473

This PR allows us to manually set a cookie with rack-test and use the default domain, then test that a Rails controller action deletes that cookie.

Most recent specification states that leading dots are ignored by user
agents: https://httpwg.org/specs/rfc6265.html#sane-domain
Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

Looking at RFC 6265, I agree that we should ignore the leading dot for domain. See requested change.

lib/rack/test/cookie_jar.rb Outdated Show resolved Hide resolved
@jeremyevans jeremyevans merged commit 70f4db2 into rack:main Feb 2, 2023
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.

2 participants