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


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

Review Comment:
   makes sense. the intermediate string is gone now: the name and value are 
copied straight into the buffer, with any control character swapped for '?' as 
it's appended, the same way the quote and backslash escaping is done. 
containsSpecialChar still runs on the raw value, which is fine since none of 
the special chars are control chars, so the quoting decision doesn't change. 
tests pass unchanged.



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