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

   RFC 6265 section 5.2.3 says that if the Domain attribute value is empty, the 
user agent should ignore that cookie-av entirely, and section 5.3 then takes 
the last remaining Domain attribute. `RFC6265CookieSpec` collapses duplicate 
attributes into a map before the handlers run, so an empty Domain overwrites an 
earlier valid one, and `BasicDomainHandler` then rejects the cookie.
   
   This change skips empty or blank Domain values when the attributes are 
collected, so they never reach the map:
   
   - `Set-Cookie: name=value; Domain=example.com; Domain=` from 
`www.example.com` was rejected and now keeps `Domain=example.com`.
   - `Set-Cookie: name=value; Domain=` was rejected and is now a host-only 
cookie for `www.example.com`.
   - `Set-Cookie: name=value; Domain=; Domain=example.com` behaves as before.
   
   Other attributes are untouched. This is the second of the three cookie items 
from the [email protected] thread. The new test is in `TestRFC6265CookieSpec`.
   
   `./mvnw -pl httpclient5 -am verify` on master (28844736) passes: 1161 tests, 
with Checkstyle, RAT and japicmp 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