Quote hreferences

RFC 4918 states that they are URIs and RFC 3986 says that URIs must always be in percent-encoded form.
This commit is contained in:
Unrud 2016-09-04 22:01:27 +02:00
parent 83046c80c4
commit eb4b513d63

View File

@ -31,7 +31,7 @@ import xml.etree.ElementTree as ET
from collections import OrderedDict from collections import OrderedDict
from datetime import datetime, timedelta, timezone from datetime import datetime, timedelta, timezone
from http import client from http import client
from urllib.parse import unquote, urlparse from urllib.parse import quote, unquote, urlparse
from . import storage from . import storage
@ -104,7 +104,7 @@ def _response(code):
def _href(base_prefix, href): def _href(base_prefix, href):
"""Return prefixed href.""" """Return prefixed href."""
return "%s%s" % (base_prefix, href) return quote("%s%s" % (base_prefix, href))
def _date_to_datetime(date_): def _date_to_datetime(date_):