Repository navigation
Conversation
Since AsyncHttpClient#2409, the client marks the cookies it takes from its cookie store, and a filter or handler reading a request's cookies gets the mark instead of the store's DefaultCookie. A cast to DefaultCookie then fails, and the SameSite and Partitioned attributes the store holds cannot be read. The mark now extends DefaultCookie and also delegates those attributes to the store's cookie, so the request reads as before. Equality, ordering and write-through to the store's cookie are unchanged. FilterContext now states two consequences of telling store cookies by the mark: a request sent to the same origin in place of another does not get back the store's cookies under the names it dropped, so one built from scratch gets only those of other names; and every cookie object a caller or a filter adds is theirs, even the store's own instance. Claude Code on behalf of Matthias Kurz Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@hyperxpro the failing job is unrelated to this pull request - it's maven central rate limiting problem. can you restart the job? Thanks! |
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.
Motivation: Since #2409, released in 3.0.15, the client marks the cookies it adds to a request from its cookie store, so that it can drop them when a filter replays or retargets the request. The mark was a plain
Cookiewrapper. Code readingRequest.getCookies(), for example a request filter, a signature calculator or a handler, therefore got a different type than before: a cast toDefaultCookiefailed, and theSameSiteandPartitionedattributes of a store cookie could not be read.Modification:
DefaultCookie. Every attribute delegates to the store's cookie, as before.DefaultCookie,SameSiteandPartitioneddelegate to it too. A cookie store that hands out anotherCookieimplementation has no such attributes to delegate to, so the mark holds them itself.FilterContext.getRequest()now states two consequences of the rules Rebind store cookies when a filter replays or retargets #2409 introduced:Result:
DefaultCookieagain, as in 3.0.14, with the store'sSameSiteandPartitionedvalues, and writes still reach the store's cookie.DefaultCookiesubclass the store may use. Equality, ordering andtoStringare unchanged.AI disclosure
Claude Code on behalf of Matthias Kurz. The commit includes
Co-Authored-ByperAGENTS.md.Test plan
All on JDK 11. Docker was not running, so the skipped tests include the Testcontainers proxy tests.
./mvnw -B -ntp -Dgpg.skip=true clean verify: 2,494 tests, 0 failures, 22 skipped; Revapi passed against 3.0.15.mainbefore the release commits.StoreCookiesas onmain): the three new tests fail.DefaultCookie: one inStoreCookiesTest, one with a request filter over HTTPS.Cookietype, which keepsSameSiteandPartitionedon the mark and writes the rest through.