HER-2016 FetchHTTP tries every url twice without credentials before sending credentials

* FetchHTTP.java
    configureHttp() - enable preemptive authentication parameter
    innerProcess() - do not call method.setDoAuthentication() (it's for automatic 401 handling which is not what we want)
This commit is contained in:
Noah Levitt
2012-07-19 13:15:27 -07:00
parent 9073d12f96
commit 6f4053cab7
@@ -633,7 +633,6 @@ public class FetchHTTP extends Processor implements Lifecycle {
if (http.getState().getProxyCredentials(new AuthScope(getProxyHost(), getProxyPort())) != null) {
addedCredentials = true;
}
method.setDoAuthentication(addedCredentials);
// set hardMax on bytes (if set by operator)
long hardMax = getMaxLengthBytes();
@@ -1451,6 +1450,8 @@ public class FetchHTTP extends Processor implements Lifecycle {
hcp.setSoTimeout(timeout);
// Set client to be version 1.0.
hcp.setVersion(HttpVersion.HTTP_1_0);
// We handle 401s, so when we do auth, we want it preemptive.
hcp.setAuthenticationPreemptive(true);
// configureHttpCookies(defaults);