mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 19:22:22 -05:00
Workaround for invalid redirect location
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1542 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
f4ad37ee6f
commit
6277125a83
@ -148,10 +148,14 @@ public class EwsExchangeSession extends ExchangeSession {
|
|||||||
// check EWS access
|
// check EWS access
|
||||||
try {
|
try {
|
||||||
checkEndPointUrl("/ews/exchange.asmx");
|
checkEndPointUrl("/ews/exchange.asmx");
|
||||||
|
// workaround for Exchange bug: send fake request
|
||||||
|
internalGetFolder("");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
try {
|
try {
|
||||||
// failover, try to retrieve EWS url from autodiscover
|
// failover, try to retrieve EWS url from autodiscover
|
||||||
checkEndPointUrl(getEwsUrlFromAutoDiscover());
|
checkEndPointUrl(getEwsUrlFromAutoDiscover());
|
||||||
|
// workaround for Exchange bug: send fake request
|
||||||
|
internalGetFolder("");
|
||||||
} catch (IOException e2) {
|
} catch (IOException e2) {
|
||||||
// autodiscover failed and initial exception was authentication failure => throw original exception
|
// autodiscover failed and initial exception was authentication failure => throw original exception
|
||||||
if (e instanceof DavMailAuthenticationException) {
|
if (e instanceof DavMailAuthenticationException) {
|
||||||
@ -164,8 +168,6 @@ public class EwsExchangeSession extends ExchangeSession {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
folderIdMap = new HashMap<String, String>();
|
folderIdMap = new HashMap<String, String>();
|
||||||
// workaround for Exchange bug: send fake request
|
|
||||||
internalGetFolder("");
|
|
||||||
// load actual well known folder ids
|
// load actual well known folder ids
|
||||||
folderIdMap.put(internalGetFolder(INBOX).folderId.value, INBOX);
|
folderIdMap.put(internalGetFolder(INBOX).folderId.value, INBOX);
|
||||||
folderIdMap.put(internalGetFolder(CALENDAR).folderId.value, CALENDAR);
|
folderIdMap.put(internalGetFolder(CALENDAR).folderId.value, CALENDAR);
|
||||||
|
@ -303,6 +303,10 @@ public final class DavGatewayHttpClientFacade {
|
|||||||
if (locationValue.indexOf('"') >= 0) {
|
if (locationValue.indexOf('"') >= 0) {
|
||||||
locationValue = URIUtil.encodePath(locationValue);
|
locationValue = URIUtil.encodePath(locationValue);
|
||||||
}
|
}
|
||||||
|
// workaround for invalid relative location
|
||||||
|
if (locationValue.startsWith("./")) {
|
||||||
|
locationValue = locationValue.substring(1);
|
||||||
|
}
|
||||||
currentMethod.releaseConnection();
|
currentMethod.releaseConnection();
|
||||||
currentMethod = new GetMethod(locationValue);
|
currentMethod = new GetMethod(locationValue);
|
||||||
currentMethod.setFollowRedirects(false);
|
currentMethod.setFollowRedirects(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user