Fix HER-1917 failure to use good http authentication type if server supports any that heritrix doesn't - problem reported and fix suggested by Adam Wilmer

* HttpAuthenticationCredential.java
    populate() 
        +  http.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY,
        +          Arrays.asList(AuthPolicy.DIGEST, AuthPolicy.BASIC));
This commit is contained in:
nlevitt
2011-07-30 01:30:44 +00:00
parent 26584d44d7
commit dcbc259776
@@ -19,6 +19,7 @@
package org.archive.modules.credential;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Set;
import java.util.logging.Logger;
@@ -27,6 +28,7 @@ import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthPolicy;
import org.apache.commons.httpclient.auth.AuthScope;
import org.archive.modules.CrawlURI;
@@ -129,6 +131,10 @@ public class HttpAuthenticationCredential extends Credential {
logger.fine("Credentials for realm " + getRealm() +
" for CrawlURI " + curi.toString() + " added to request: " +
result);
http.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY,
Arrays.asList(AuthPolicy.DIGEST, AuthPolicy.BASIC));
result = true;
} catch (URIException e) {
logger.severe("Failed to parse host from " + curi + ": " +