From eb4b513d6311981e6bc6a0d3c6eb856bab99f8b2 Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 4 Sep 2016 22:01:27 +0200 Subject: [PATCH] Quote hreferences RFC 4918 states that they are URIs and RFC 3986 says that URIs must always be in percent-encoded form. --- radicale/xmlutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index c9b12894..c3215a56 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -31,7 +31,7 @@ import xml.etree.ElementTree as ET from collections import OrderedDict from datetime import datetime, timedelta, timezone from http import client -from urllib.parse import unquote, urlparse +from urllib.parse import quote, unquote, urlparse from . import storage @@ -104,7 +104,7 @@ def _response(code): def _href(base_prefix, href): """Return prefixed href.""" - return "%s%s" % (base_prefix, href) + return quote("%s%s" % (base_prefix, href)) def _date_to_datetime(date_):