ok2c commented on code in PR #924:
URL: 
https://github.com/apache/httpcomponents-client/pull/924#discussion_r4473146699


##########
httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestAddCookies.java:
##########
@@ -108,23 +108,20 @@ public void process(final HttpRequest request, final 
EntityDetails entity, final
         Args.notNull(request, "HTTP request");
         Args.notNull(context, "HTTP context");
 
+        final HttpClientContext clientContext = 
HttpClientContext.cast(context);
+        final String exchangeId = clientContext.getExchangeId();
+
+        // Discard the CookieSpec and CookieOrigin of a previous exchange 
executed with
+        // this context so the response interceptor never processes Set-Cookie 
headers
+        // against the origin of another request
+        clientContext.setCookieSpec(null);
+        clientContext.setCookieOrigin(null);
+

Review Comment:
   @Hsnmohd Very good catch. 
   
   However, I would rather keep the cookie spec and cookie origin `null` in 
case the `Cookie` header has manually added and not generated by 
`RequestAddCookies`, and let `ResponseProcessCookies` take no action. Would you 
agree to that?



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