remove useless normalization, see #745

This commit is contained in:
Markus Unterwaditzer 2018-06-13 15:18:34 +02:00
parent 579b2ca5d9
commit 556ec88578

View file

@ -60,31 +60,11 @@ def _assert_multistatus_success(r):
def _normalize_href(base, href):
'''Normalize the href to be a path only relative to hostname and
schema.'''
orig_href = href
if not href:
raise ValueError(href)
x = urlparse.urljoin(base, href)
x = urlparse.urlsplit(x).path
# Encoding issues:
# - https://github.com/owncloud/contacts/issues/581
# - https://github.com/Kozea/Radicale/issues/298
old_x = None
while old_x is None or x != old_x:
if _contains_quoted_reserved_chars(x):
break
old_x = x
x = urlparse.unquote(x)
x = urlparse.quote(x, '/@%:')
if orig_href == x:
dav_logger.debug('Already normalized: {!r}'.format(x))
else:
dav_logger.debug('Normalized URL from {!r} to {!r}'
.format(orig_href, x))
return x