mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 03:11:54 +00:00
Fix unnecessary traceback in authenticated_rest_api_view.
Apparently, we weren't returning the `json_error`, resulting in users
encountering this condition receiving a 500, rather than the proper
40x error.
This fixes a regresion introduced in 9ae68ade8b.
This commit is contained in:
@@ -375,7 +375,7 @@ def authenticated_rest_api_view(is_webhook=False):
|
|||||||
return json_error(_("Only Basic authentication is supported."))
|
return json_error(_("Only Basic authentication is supported."))
|
||||||
role, api_key = base64.b64decode(force_bytes(credentials)).decode('utf-8').split(":")
|
role, api_key = base64.b64decode(force_bytes(credentials)).decode('utf-8').split(":")
|
||||||
except ValueError:
|
except ValueError:
|
||||||
json_error(_("Invalid authorization header for basic auth"))
|
return json_unauthorized(_("Invalid authorization header for basic auth"))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return json_unauthorized("Missing authorization header for basic auth")
|
return json_unauthorized("Missing authorization header for basic auth")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user