mirror of
https://github.com/moparisthebest/davmail
synced 2024-08-13 16:53:51 -04:00
Do not decode attachment URL twice (fails with % in message title)
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@104 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
44e4ebf07c
commit
3f7f9aca5c
@ -958,13 +958,12 @@ public class ExchangeSession {
|
|||||||
} catch (MessagingException e) {
|
} catch (MessagingException e) {
|
||||||
throw new IOException(e + " " + e.getMessage());
|
throw new IOException(e + " " + e.getMessage());
|
||||||
}
|
}
|
||||||
String decodedPath = URIUtil.decode(attachment.href);
|
|
||||||
|
|
||||||
if ("message/rfc822".equalsIgnoreCase(mimeHeader.contentType)) {
|
if ("message/rfc822".equalsIgnoreCase(mimeHeader.contentType)) {
|
||||||
String messageAttachmentPath = null;
|
String messageAttachmentPath = null;
|
||||||
|
|
||||||
// Get real attachment path from owa page content
|
// Get real attachment path from owa page content
|
||||||
GetMethod method = new GetMethod(URIUtil.encodePath(decodedPath));
|
GetMethod method = new GetMethod(URIUtil.encodePath(attachment.href));
|
||||||
wdr.retrieveSessionInstance().executeMethod(method);
|
wdr.retrieveSessionInstance().executeMethod(method);
|
||||||
String body = method.getResponseBodyAsString();
|
String body = method.getResponseBodyAsString();
|
||||||
final String URL_DECLARATION = "var g_szURL\t= \"";
|
final String URL_DECLARATION = "var g_szURL\t= \"";
|
||||||
@ -986,7 +985,7 @@ public class ExchangeSession {
|
|||||||
attachedMessage.write(quotedOs);
|
attachedMessage.write(quotedOs);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
GetMethod method = new GetMethod(URIUtil.encodePath(decodedPath));
|
GetMethod method = new GetMethod(URIUtil.encodePath(attachment.href));
|
||||||
wdr.retrieveSessionInstance().executeMethod(method);
|
wdr.retrieveSessionInstance().executeMethod(method);
|
||||||
|
|
||||||
// encode attachment
|
// encode attachment
|
||||||
|
Loading…
Reference in New Issue
Block a user