1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-14 11:42:23 -05:00

Detect redirect form instead of logon form, follow redirect to logon form

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@789 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-10-25 22:24:53 +00:00
parent 316ab31b76
commit 83cb84e579

View File

@ -285,6 +285,8 @@ public class ExchangeSession {
if (path.startsWith("/")) {
// path is absolute, replace method path
uri.setPath(path);
} else if (path.startsWith("http://") || path.startsWith("https://")){
return path;
} else {
// relative path, build new path
String currentPath = method.getPath();
@ -363,6 +365,10 @@ public class ExchangeSession {
userNameInput = "txtUserName";
} else if ("txtUserPass".equals(name)) {
passwordInput = "txtUserPass";
} else if ("addr".equals(name)) {
// this is not a logon form but a redirect form
HttpMethod newInitMethod = DavGatewayHttpClientFacade.executeFollowRedirects(httpClient, logonMethod);
logonMethod = buildLogonMethod(httpClient, newInitMethod);
}
}
} else {
@ -1750,7 +1756,7 @@ public class ExchangeSession {
for (File file : oldestFiles) {
if (!file.delete()) {
LOGGER.warn("Unable to delete " + file.getAbsolutePath());
}
}
}
} catch (Exception ex) {
LOGGER.warn("Error deleting ics dump: " + ex.getMessage());