Skip to content

Commit

Permalink
Force cookies on same Cookie header
Browse files Browse the repository at this point in the history
  • Loading branch information
thc202 committed Jan 18, 2018
1 parent e20c1ae commit 3100ef2
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/org/apache/commons/httpclient/HttpMethodBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1347,17 +1347,8 @@ protected void addCookieRequestHeader(HttpState state, HttpConnection conn)
}
Cookie[] cookies = matcher.match(host, conn.getPort(),
getPath(), conn.isSecure(), state.getCookies());
if ((cookies != null) && (cookies.length > 0)) {
if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) {
// In strict mode put all cookies on the same header
putAllCookiesInASingleHeader(host, matcher, cookies);
} else {
// In non-strict mode put each cookie on a separate header
for (int i = 0; i < cookies.length; i++) {
String s = matcher.formatCookie(cookies[i]);
getRequestHeaderGroup().addHeader(new Header(HttpHeader.COOKIE, s, true));
}
}
if ((cookies != null && cookies.length > 0) || cookieheaders.length > 0) {
putAllCookiesInASingleHeader(host, matcher, cookies);
if (matcher instanceof CookieVersionSupport) {
CookieVersionSupport versupport = (CookieVersionSupport) matcher;
int ver = versupport.getVersion();
Expand Down

0 comments on commit 3100ef2

Please sign in to comment.