1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-01-12 22:18:11 -05:00

Fix regression on basic authentication after refactoring

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@459 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-03-19 09:32:00 +00:00
parent a38055b5ea
commit 554305e52b

View File

@ -40,10 +40,15 @@ public final class DavGatewayHttpClientFacade {
return httpClient; return httpClient;
} }
public static HttpClient getInstance(HttpURL httpURL) { public static HttpClient getInstance(HttpURL httpURL) throws URIException {
HttpClient httpClient = new HttpClient(); HttpClient httpClient = new HttpClient();
HostConfiguration hostConfig = httpClient.getHostConfiguration(); HostConfiguration hostConfig = httpClient.getHostConfiguration();
hostConfig.setHost(httpURL); hostConfig.setHost(httpURL);
UsernamePasswordCredentials hostCredentials =
new UsernamePasswordCredentials(httpURL.getUser(),
httpURL.getPassword());
httpClient.getState().setCredentials(null, httpURL.getHost(),
hostCredentials);
configureClient(httpClient); configureClient(httpClient);
return httpClient; return httpClient;
} }