You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2025/02/05 16:24:01 UTC
(httpcomponents-client) branch HTTPCLIENT-2361 created (now b7ece752e)
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a change to branch HTTPCLIENT-2361
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
at b7ece752e HTTPCLIENT-2361: Tolerate multiple `Cookie` headers added by the caller
This branch includes the following new commits:
new b7ece752e HTTPCLIENT-2361: Tolerate multiple `Cookie` headers added by the caller
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(httpcomponents-client) 01/01: HTTPCLIENT-2361: Tolerate multiple `Cookie` headers added by the caller
Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch HTTPCLIENT-2361
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
commit b7ece752eb52450c6190ae002ae84293ac56b5a9
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Wed Feb 5 17:16:39 2025 +0100
HTTPCLIENT-2361: Tolerate multiple `Cookie` headers added by the caller
---
.../java/org/apache/hc/client5/http/protocol/RequestAddCookies.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestAddCookies.java b/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestAddCookies.java
index 836c988cf..cf50c999c 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestAddCookies.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestAddCookies.java
@@ -91,9 +91,8 @@ public void process(final HttpRequest request, final EntityDetails entity, final
return;
}
- final Header cookieHeader = request.getHeader(HttpHeaders.COOKIE);
// Check if a Cookie header is already present
- if (cookieHeader != null) {
+ if (request.containsHeader(HttpHeaders.COOKIE)) {
if (LOG.isDebugEnabled()) {
LOG.debug("Skipping cookie addition, Cookie header already present in the request");
}