mirror of
https://github.com/simple-login/app.git
synced 2025-02-21 22:32:56 +08:00
add more check to new custom alias
This commit is contained in:
parent
5b60869a39
commit
d322d543af
1 changed files with 5 additions and 2 deletions
|
@ -40,8 +40,11 @@ def new_custom_alias():
|
|||
hostname = request.args.get("hostname")
|
||||
|
||||
data = request.get_json()
|
||||
alias_prefix = data["alias_prefix"]
|
||||
alias_suffix = data["alias_suffix"]
|
||||
if not data:
|
||||
return jsonify(error="request body cannot be empty"), 400
|
||||
|
||||
alias_prefix = data.get("alias_prefix", "")
|
||||
alias_suffix = data.get("alias_suffix", "")
|
||||
|
||||
# make sure alias_prefix is not empty
|
||||
alias_prefix = alias_prefix.strip()
|
||||
|
|
Loading…
Reference in a new issue