Browse Source

Error message if path not starting with prefix
Before the program crashed implicitly

Unrud 10 năm trước cách đây
mục cha
commit
ed44830447
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      radicale/__init__.py

+ 3 - 1
radicale/__init__.py

@@ -265,7 +265,9 @@ class Application(object):
             # Request path not starting with base_prefix, not allowed
             log.LOGGER.debug(
                 "Path not starting with prefix: %s", environ["PATH_INFO"])
-            environ["PATH_INFO"] = None
+            status, headers, _ = NOT_ALLOWED
+            start_response(status, list(headers.items()))
+            return []
 
         # Sanitize request URI
         environ["PATH_INFO"] = self.sanitize_uri(environ["PATH_INFO"])