summaryrefslogtreecommitdiff
path: root/kvmd/plugins/auth/http.py
diff options
context:
space:
mode:
Diffstat (limited to 'kvmd/plugins/auth/http.py')
-rw-r--r--kvmd/plugins/auth/http.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/kvmd/plugins/auth/http.py b/kvmd/plugins/auth/http.py
index 2daf5540..6cd959ae 100644
--- a/kvmd/plugins/auth/http.py
+++ b/kvmd/plugins/auth/http.py
@@ -34,6 +34,7 @@ from ...validators.basic import valid_float_f01
from ...logging import get_logger
from ... import make_user_agent
+from ... import aiotools
from . import BaseAuthService
@@ -89,10 +90,8 @@ class Plugin(BaseAuthService):
"X-KVMD-User": user,
},
) as response:
- response.raise_for_status()
- if response.status == 200:
- return True
- raise RuntimeError(f"Invalid OK response: {response.status} {await response.text()}; expected 200")
+ aiotools.raise_not_200(response)
+ return True
except Exception:
get_logger().exception("Failed HTTP auth request for user %r", user)
return False