1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 11:12:22 -05:00

IMAP: First fix for bug 2840255, do not follow redirects on message FETCH

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@684 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-08-31 21:12:07 +00:00
parent b053ceaf67
commit cdf3ebe683

View File

@ -1277,7 +1277,12 @@ public class ExchangeSession {
method = new GetMethod(URIUtil.encodePath(messageUrl));
method.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
method.setRequestHeader("Translate", "f");
httpClient.executeMethod(method);
// do not follow redirects in expired session
method.setFollowRedirects(false);
int status = httpClient.executeMethod(method);
if (status != HttpStatus.SC_OK) {
throw DavGatewayHttpClientFacade.buildHttpException(method);
}
reader = new BufferedReader(new InputStreamReader(method.getResponseBodyAsStream()));
OutputStreamWriter isoWriter = new OutputStreamWriter(os);