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

Merge pull request #1343 from fasterit/master

Add check for base_prefix indicating Radicale running at site root (/)
Peter Bieringer 1 год назад
Родитель
Сommit
c5b48c1ee4
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      radicale/app/__init__.py

+ 1 - 1
radicale/app/__init__.py

@@ -197,7 +197,7 @@ class Application(ApplicationPartDelete, ApplicationPartHead,
             if base_prefix_src == "HTTP_X_SCRIPT_NAME":
             if base_prefix_src == "HTTP_X_SCRIPT_NAME":
                 return response(*httputils.BAD_REQUEST)
                 return response(*httputils.BAD_REQUEST)
             return response(*httputils.INTERNAL_SERVER_ERROR)
             return response(*httputils.INTERNAL_SERVER_ERROR)
-        if base_prefix.endswith("/"):
+        if base_prefix and base_prefix != "/" and base_prefix.endswith("/"):
             logger.warning("Base prefix (from %s) must not end with '/': %r",
             logger.warning("Base prefix (from %s) must not end with '/': %r",
                            base_prefix_src, base_prefix)
                            base_prefix_src, base_prefix)
             base_prefix = base_prefix.rstrip("/")
             base_prefix = base_prefix.rstrip("/")