Просмотр исходного кода

Fix double slash in REPORT responses

When doing REPORTs with absolute paths as hrefs, the response hrefs
contain a double slash at the beginning. This breaks URL parsers and
makes them assume they have a URL without protocol of the format
`//example.com/foo/bar/`.
Markus Unterwaditzer 10 лет назад
Родитель
Сommit
1b1ba421ff
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      radicale/xmlutils.py

+ 1 - 1
radicale/xmlutils.py

@@ -565,7 +565,7 @@ def report(path, xml_request, collection):
             # TODO: fix this
             # TODO: fix this
             if hreference.split("/")[-1] == item.href:
             if hreference.split("/")[-1] == item.href:
                 # Happening when depth is 0
                 # Happening when depth is 0
-                uri = "/" + hreference
+                uri = hreference
             else:
             else:
                 # Happening when depth is 1
                 # Happening when depth is 1
                 uri = posixpath.join(hreference, item.href)
                 uri = posixpath.join(hreference, item.href)