1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-21 15:08:52 -05:00

EWS: switch to GetMethod to check endpoint

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2312 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2014-09-04 06:41:39 +00:00
parent 15fd928588
commit 58d03e039b

View File

@ -172,7 +172,7 @@ public class EwsExchangeSession extends ExchangeSession {
* @throws IOException on error * @throws IOException on error
*/ */
protected void checkEndPointUrl(String endPointUrl) throws IOException { protected void checkEndPointUrl(String endPointUrl) throws IOException {
HttpMethod checkMethod = new HeadMethod(endPointUrl); HttpMethod checkMethod = new GetMethod(endPointUrl);
checkMethod.setPath("/ews/services.wsdl"); checkMethod.setPath("/ews/services.wsdl");
checkMethod.setFollowRedirects(false); checkMethod.setFollowRedirects(false);
try { try {
@ -180,7 +180,7 @@ public class EwsExchangeSession extends ExchangeSession {
if (status == HttpStatus.SC_UNAUTHORIZED) { if (status == HttpStatus.SC_UNAUTHORIZED) {
// retry with /ews/exchange.asmx // retry with /ews/exchange.asmx
checkMethod.releaseConnection(); checkMethod.releaseConnection();
checkMethod = new HeadMethod(endPointUrl); checkMethod = new GetMethod(endPointUrl);
checkMethod.setFollowRedirects(true); checkMethod.setFollowRedirects(true);
status = DavGatewayHttpClientFacade.executeNoRedirect(httpClient, checkMethod); status = DavGatewayHttpClientFacade.executeNoRedirect(httpClient, checkMethod);
if (status == HttpStatus.SC_UNAUTHORIZED) { if (status == HttpStatus.SC_UNAUTHORIZED) {