mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
remove useless normalization, see #745
This commit is contained in:
parent
579b2ca5d9
commit
556ec88578
1 changed files with 0 additions and 20 deletions
|
|
@ -60,31 +60,11 @@ def _assert_multistatus_success(r):
|
||||||
def _normalize_href(base, href):
|
def _normalize_href(base, href):
|
||||||
'''Normalize the href to be a path only relative to hostname and
|
'''Normalize the href to be a path only relative to hostname and
|
||||||
schema.'''
|
schema.'''
|
||||||
orig_href = href
|
|
||||||
if not href:
|
if not href:
|
||||||
raise ValueError(href)
|
raise ValueError(href)
|
||||||
|
|
||||||
x = urlparse.urljoin(base, href)
|
x = urlparse.urljoin(base, href)
|
||||||
x = urlparse.urlsplit(x).path
|
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
|
return x
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue