From 67fb895cf47bb95b26e2115c634f9e261ec526b7 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 2 Nov 2020 15:45:24 +0100 Subject: [PATCH] [Plugin] auth: Handle exception if data is not json --- flaschengeist/plugins/auth/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaschengeist/plugins/auth/__init__.py b/flaschengeist/plugins/auth/__init__.py index ef84ae7..9889e04 100644 --- a/flaschengeist/plugins/auth/__init__.py +++ b/flaschengeist/plugins/auth/__init__.py @@ -36,7 +36,7 @@ def login(): try: userid = data["userid"] password = data["password"] - except KeyError: + except (KeyError, ValueError): raise BadRequest("Missing parameter(s)") logger.debug("search user {{ {} }} in database".format(userid))