Caldav: iCal fails with CalDAVMultiGetOperation not a server error, but bad data

=> replaced & encoding with URIUtil.encodeWithinQuery

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@365 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-02-17 00:54:09 +00:00
parent a21cfb1b8a
commit 23aa8311eb
1 changed files with 3 additions and 3 deletions

View File

@ -277,9 +277,9 @@ public class CaldavConnection extends AbstractConnection {
}
protected void appendEventResponse(StringBuilder buffer, CaldavRequest request, ExchangeSession.Event event) throws IOException {
String eventPath = event.getPath().replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
String eventPath = event.getPath().replaceAll("<", "&lt;").replaceAll(">", "&gt;");
buffer.append("<D:response>");
buffer.append("<D:href>/users/").append(session.getEmail()).append("/calendar").append(URIUtil.encodePath(eventPath)).append("</D:href>");
buffer.append("<D:href>/users/").append(session.getEmail()).append("/calendar").append(URIUtil.encodeWithinQuery(eventPath)).append("</D:href>");
buffer.append("<D:propstat>");
buffer.append("<D:prop>");
if (request.hasProperty("calendar-data")) {
@ -482,7 +482,7 @@ public class CaldavConnection extends AbstractConnection {
// send not found events errors
for (String href : notFound) {
buffer.append("<D:response>");
buffer.append("<D:href>").append(URIUtil.encodePath(href)).append("</D:href>");
buffer.append("<D:href>").append(URIUtil.encodeWithinQuery(href)).append("</D:href>");
buffer.append("<D:propstat>");
buffer.append("<D:status>HTTP/1.1 404 Not Found</D:status>");
buffer.append("</D:propstat>");