Skip to content

Commit

Permalink
Revert changes done for zaproxy#4079
Browse files Browse the repository at this point in the history
  • Loading branch information
thc202 committed Jan 16, 2018
1 parent e20c1ae commit a4a539d
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/org/parosproxy/paros/network/HttpSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
// ZAP: 2017/06/12 Allow to ignore listeners.
// ZAP: 2017/06/19 Allow to send a request with custom socket timeout.
// ZAP: 2017/11/20 Add initiator constant for Token Generator requests.
// ZAP: 2017/11/27 Use custom CookieSpec (ZapCookieSpec).

package org.parosproxy.paros.network;

Expand Down Expand Up @@ -104,7 +103,6 @@
import org.zaproxy.zap.ZapGetMethod;
import org.zaproxy.zap.ZapHttpConnectionManager;
import org.zaproxy.zap.network.HttpSenderListener;
import org.zaproxy.zap.network.ZapCookieSpec;
import org.zaproxy.zap.network.HttpRedirectionValidator;
import org.zaproxy.zap.network.HttpRequestConfig;
import org.zaproxy.zap.network.ZapNTLMScheme;
Expand Down Expand Up @@ -147,8 +145,6 @@ public class HttpSender {
}

AuthPolicy.registerAuthScheme(AuthPolicy.NTLM, ZapNTLMScheme.class);
CookiePolicy.registerCookieSpec(CookiePolicy.DEFAULT, ZapCookieSpec.class);
CookiePolicy.registerCookieSpec(CookiePolicy.BROWSER_COMPATIBILITY, ZapCookieSpec.class);
}

private static HttpMethodHelper helper = new HttpMethodHelper();
Expand Down Expand Up @@ -209,16 +205,9 @@ public HttpSender(ConnectionParam connectionParam, boolean useGlobalState, int i

if (useGlobalState) {
checkState();
} else {
setClientsCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
}
}

private void setClientsCookiePolicy(String policy) {
client.getParams().setCookiePolicy(policy);
clientViaProxy.getParams().setCookiePolicy(policy);
}

public static SSLConnector getSSLConnector() {
return (SSLConnector) protocol.getSocketFactory();
}
Expand All @@ -227,9 +216,11 @@ private void checkState() {
if (param.isHttpStateEnabled()) {
client.setState(param.getHttpState());
clientViaProxy.setState(param.getHttpState());
setClientsCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
clientViaProxy.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
} else {
setClientsCookiePolicy(CookiePolicy.IGNORE_COOKIES);
client.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
clientViaProxy.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
}
}

Expand Down

0 comments on commit a4a539d

Please sign in to comment.