From 577d9317d2231983875cd940e8174c9fdd229db2 Mon Sep 17 00:00:00 2001 From: Unrud Date: Mon, 22 May 2017 20:44:24 +0200 Subject: [PATCH] Strip script name from path --- radicale/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/radicale/__init__.py b/radicale/__init__.py index b6da193..a9b4c41 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -358,6 +358,9 @@ class Application: environ["PATH_INFO"] = storage.sanitize_path(environ["PATH_INFO"]) self.logger.debug("Sanitized path: %s", environ["PATH_INFO"]) path = environ["PATH_INFO"] + if base_prefix and path.startswith(base_prefix): + path = path[len(base_prefix):] + self.logger.debug("Stripped script name from path: %s", path) # Get function corresponding to method function = getattr(self, "do_%s" % environ["REQUEST_METHOD"].upper())