DicksonWu654 opened a new pull request, #944:
URL: https://github.com/apache/httpcomponents-client/pull/944

   The default cookie spec registry (`CookieSpecSupport`) and 
`RFC6265CookieSpecFactory` with a `PublicSuffixMatcher` both wrap the domain 
handler in `PublicSuffixDomainFilter`. The public no-argument constructors of 
`RFC6265LaxSpec` and `RFC6265StrictSpec` use `BasicDomainHandler` directly 
instead.
   
   So code that builds a registry from `new RFC6265LaxSpec()` or `new 
RFC6265StrictSpec()` gets different domain handling from the default client. It 
accepts a cookie from `foo.com` with `Domain=com` and later sends that cookie 
to `bar.com`. The default registry rejects the same cookie.
   
   This change makes the two no-arg constructors decorate `BasicDomainHandler` 
with `PublicSuffixDomainFilter` and `PublicSuffixMatcherLoader.getDefault()`, 
so they match the default registry. The package-private constructors that take 
explicit handlers are unchanged.
   
   A test in `TestRFC6265CookieSpec` covers both specs. It checks that a 
`Domain=com` cookie from `foo.com` doesn't match `bar.com`, and that a 
`Domain=example.com` cookie from `foo.example.com` still matches 
`bar.example.com`.
   
   `./mvnw -pl httpclient5 test` on master (4e109b0e) passes: 1157 tests 
before, 1158 after, with Checkstyle passing.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to