Quellcode durchsuchen

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 vor 10 Jahren
Ursprung
Commit
1b1ba421ff
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      radicale/xmlutils.py

+ 1 - 1
radicale/xmlutils.py

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