Преглед изворни кода

Handle use in a subdir. Patch from Clint Adams <clint@softwarefreedom.org> adapted from http://redmine.kozea.fr/issues/996

Fabrice Bellet пре 13 година
родитељ
комит
54bda5594c
3 измењених фајлова са 5 додато и 2 уклоњено
  1. 2 1
      config
  2. 2 1
      radicale/config.py
  3. 1 0
      radicale/xmlutils.py

+ 2 - 1
config

@@ -27,7 +27,8 @@ certificate = /etc/apache2/ssl/server.crt
 key = /etc/apache2/ssl/server.key
 # Reverse DNS to resolve client address in logs
 dns_lookup = True
-
+# base URL if / is not the CalDAV root
+base_prefix =
 
 [encoding]
 # Encoding for responding requests

+ 2 - 1
radicale/config.py

@@ -45,7 +45,8 @@ INITIAL_CONFIG = {
         "ssl": "False",
         "certificate": "/etc/apache2/ssl/server.crt",
         "key": "/etc/apache2/ssl/server.key",
-        "dns_lookup": "True"},
+        "dns_lookup": "True",
+        "base_prefix": ""},
     "encoding": {
         "request": "utf-8",
         "stock": "utf-8"},

+ 1 - 0
radicale/xmlutils.py

@@ -227,6 +227,7 @@ def _propfind_response(path, item, props, user):
 
     href = ET.Element(_tag("D", "href"))
     uri = item.url if is_collection else "%s/%s" % (path, item.name)
+    uri = "%s/%s" % (config.get("server", "base_prefix"), uri)
     href.text = uri.replace("//", "/")
     response.append(href)