mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Separate errors for unicode/binascii
This commit is contained in:
parent
1a7c76dca7
commit
c2c10d4609
@ -150,7 +150,7 @@ class PublicHandler(BaseHandler):
|
|||||||
entered_password = urllib.parse.unquote(
|
entered_password = urllib.parse.unquote(
|
||||||
base64.b64decode(data["password"]).decode("utf-8")
|
base64.b64decode(data["password"]).decode("utf-8")
|
||||||
)
|
)
|
||||||
except (binascii.Error, UnicodeDecodeError):
|
except binascii.Error:
|
||||||
return self.finish_json(
|
return self.finish_json(
|
||||||
403,
|
403,
|
||||||
{
|
{
|
||||||
@ -160,6 +160,14 @@ class PublicHandler(BaseHandler):
|
|||||||
" Uh oh! Stinky 💩",
|
" Uh oh! Stinky 💩",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
return self.finish_json(
|
||||||
|
403,
|
||||||
|
{
|
||||||
|
"status": "error",
|
||||||
|
"error": "VWggb2ghIFN0aW5reSDwn5Kp",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
user_id = HelperUsers.get_user_id_by_name(entered_username.lower())
|
user_id = HelperUsers.get_user_id_by_name(entered_username.lower())
|
||||||
|
Loading…
Reference in New Issue
Block a user