dxbjavid commented on code in PR #900:
URL: 
https://github.com/apache/httpcomponents-client/pull/900#discussion_r4366004226


##########
httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/RFC6265CookieSpec.java:
##########
@@ -236,8 +242,11 @@ public List<Header> formatCookies(final List<Cookie> 
cookies) {
                 buffer.append(PARAM_DELIMITER);
                 buffer.append(' ');
             }
-            buffer.append(cookie.getName());

Review Comment:
   fair point, formatCookies is the wrong place to fail. it now runs the name 
and value through a replacement that swaps each control char (%x00-1F or %x7F) 
for '?' rather than throwing, which matches what the session output buffer 
already does on write, so a cookie coming back out of the store can't split the 
header. validate() still rejects one on the way in, so this is just a defensive 
fallback for anything that bypassed validation. tests updated to assert the 
sanitised wire output.



-- 
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