From c9a78908e8447162164b3d1220e5835ff2ba5306 Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 17 Sep 2017 14:03:44 +0200 Subject: [PATCH] Check .well-known before getting login and password cosmetic change --- radicale/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index 94c6157..08704c0 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -420,6 +420,10 @@ class Application: # Get function corresponding to method function = getattr(self, "do_%s" % environ["REQUEST_METHOD"].upper()) + # If "/.well-known" is not available, clients query "/" + if path == "/.well-known" or path.startswith("/.well-known/"): + return response(*NOT_FOUND) + # Ask authentication backend to check rights external_login = self.Auth.get_external_login(environ) authorization = environ.get("HTTP_AUTHORIZATION", "") @@ -435,10 +439,6 @@ class Application: password = "" user = self.Auth.map_login_to_user(login) - # If "/.well-known" is not available, clients query "/" - if path == "/.well-known" or path.startswith("/.well-known/"): - return response(*NOT_FOUND) - if not user: is_authenticated = True elif not storage.is_safe_path_component(user):