1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 03:02:22 -05:00

Enable preemptive authentication to avoid most 401 requests

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@280 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-01-07 13:29:11 +00:00
parent 21348d9bc2
commit 47a0aef919

View File

@ -3,14 +3,11 @@ package davmail.http;
import davmail.Settings; import davmail.Settings;
import davmail.tray.DavGatewayTray; import davmail.tray.DavGatewayTray;
import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.util.URIUtil;
import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.util.URIUtil;
import org.apache.webdav.lib.methods.SearchMethod; import org.apache.webdav.lib.methods.SearchMethod;
import org.apache.webdav.lib.ResponseEntity;
import java.io.IOException; import java.io.IOException;
import java.util.List;
import java.util.ArrayList;
import java.util.Enumeration; import java.util.Enumeration;
/** /**
@ -48,9 +45,6 @@ public final class DavGatewayHttpClientFacade {
public static void configureClient(HttpClient httpClient) { public static void configureClient(HttpClient httpClient) {
httpClient.setHttpConnectionManager(multiThreadedHttpConnectionManager); httpClient.setHttpConnectionManager(multiThreadedHttpConnectionManager);
// do not send basic auth automatically
httpClient.getState().setAuthenticationPreemptive(false);
boolean enableProxy = Settings.getBooleanProperty("davmail.enableProxy"); boolean enableProxy = Settings.getBooleanProperty("davmail.enableProxy");
String proxyHost = null; String proxyHost = null;
int proxyPort = 0; int proxyPort = 0;