diff --git a/src/java/davmail/caldav/CaldavConnection.java b/src/java/davmail/caldav/CaldavConnection.java index 02d8340f..1c6c6e3e 100644 --- a/src/java/davmail/caldav/CaldavConnection.java +++ b/src/java/davmail/caldav/CaldavConnection.java @@ -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("&", "&").replaceAll("<", "<").replaceAll(">", ">"); + String eventPath = event.getPath().replaceAll("<", "<").replaceAll(">", ">"); buffer.append(""); - buffer.append("/users/").append(session.getEmail()).append("/calendar").append(URIUtil.encodePath(eventPath)).append(""); + buffer.append("/users/").append(session.getEmail()).append("/calendar").append(URIUtil.encodeWithinQuery(eventPath)).append(""); buffer.append(""); buffer.append(""); 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(""); - buffer.append("").append(URIUtil.encodePath(href)).append(""); + buffer.append("").append(URIUtil.encodeWithinQuery(href)).append(""); buffer.append(""); buffer.append("HTTP/1.1 404 Not Found"); buffer.append("");