From ab6264bd5e65497121139eab6deae353e06d592f Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Mon, 16 Mar 2020 02:46:53 +0300 Subject: auth only on 200 --- kvmd/plugins/auth/http.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'kvmd/plugins/auth/http.py') diff --git a/kvmd/plugins/auth/http.py b/kvmd/plugins/auth/http.py index 7e8d6c1e..66e23ea1 100644 --- a/kvmd/plugins/auth/http.py +++ b/kvmd/plugins/auth/http.py @@ -88,8 +88,9 @@ class Plugin(BaseAuthService): }, ) as response: response.raise_for_status() - assert response.status == 200 - return True + if response.status == 200: + return True + raise RuntimeError(f"Invalid OK response: {response.status} {await response.text()}; expected 200") except Exception: get_logger().exception("Failed HTTP auth request for user %r", user) return False -- cgit v1.2.3