1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-11-11 03:45:03 -05:00

Avoid 401 roundtrips

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@577 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-05-21 10:47:10 +00:00
parent d28bb80947
commit b555586cde

View File

@ -6,6 +6,7 @@ import davmail.exception.DavMailAuthenticationException;
import davmail.exception.DavMailException; import davmail.exception.DavMailException;
import davmail.http.DavGatewayHttpClientFacade; import davmail.http.DavGatewayHttpClientFacade;
import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.params.HttpClientParams;
import org.apache.commons.httpclient.methods.ByteArrayRequestEntity; import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.PostMethod;
@ -154,6 +155,8 @@ public class ExchangeSession {
httpClient = DavGatewayHttpClientFacade.getInstance(httpURL); httpClient = DavGatewayHttpClientFacade.getInstance(httpURL);
// avoid 401 roundtrips
httpClient.getParams().setParameter(HttpClientParams.PREEMPTIVE_AUTHENTICATION, true);
// get webmail root url // get webmail root url
// providing credentials // providing credentials