Skip to content

Commit b7ece75

Browse files
committed
HTTPCLIENT-2361: Tolerate multiple Cookie headers added by the caller
1 parent ad82f0d commit b7ece75

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestAddCookies.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ public void process(final HttpRequest request, final EntityDetails entity, final
9191
return;
9292
}
9393

94-
final Header cookieHeader = request.getHeader(HttpHeaders.COOKIE);
9594
// Check if a Cookie header is already present
96-
if (cookieHeader != null) {
95+
if (request.containsHeader(HttpHeaders.COOKIE)) {
9796
if (LOG.isDebugEnabled()) {
9897
LOG.debug("Skipping cookie addition, Cookie header already present in the request");
9998
}

0 commit comments

Comments
 (0)