Repository navigation
Match cookies whose value contains '=' - #235
Merged
Merged
Conversation
CookieMatcher split each cookie on every '=', so base64 cookies like session=YWJjZA== were compared as 'YWJjZA' and never matched.
pimterry
reviewed
Nov 23, 2026
Contributor
Author
|
@pimterry signed the CLA. Can you please review this when you have some time. |
Member
|
Merged, thanks @bardrop! Will release shortly with some other changes I'm working on. By the way, in case you're not aware, HTTP Toolkit Pro is free for all contributors to all https://github.com/httptoolkit repos. If that would be useful, just let me know your email (either here or by sending a message to opensource @ httptoolkit.com) and I'll set you up with an account. |
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.
withCookie()splits each cookie on every=and keeps only the first two parts, so a value that contains=is cut.Cookie: session=YWJjZA==is compared asYWJjZA:.withCookie({ session: 'YWJjZA==' })never matches.withCookie({ session: 'YWJjZA' })matches when it should notThis is common with base64 session cookies and signed cookies. The name and value are now split on the first
=only, which is how RFC 6265 section 5.2 parses them.I added two cases to
cookie-matching.spec.ts(full value matches, truncated value does not). The first fails without the change. The node matcher tests all pass (124); I didn't run the browser build.