forked from 3wordchant/capsul-flask
fix bug when created query string is not present
This commit is contained in:
parent
684128361c
commit
62a062fff2
@ -72,7 +72,7 @@ def magiclink(token):
|
|||||||
return redirect(url_for("console.index"))
|
return redirect(url_for("console.index"))
|
||||||
else:
|
else:
|
||||||
# this is here to prevent xss
|
# this is here to prevent xss
|
||||||
if not re.match(r"^[a-zA-Z0-9_-]+$", token):
|
if token and not re.match(r"^[a-zA-Z0-9_-]+$", token):
|
||||||
token = '___________'
|
token = '___________'
|
||||||
|
|
||||||
abort(404, f"Token {token} doesn't exist or has already been used.")
|
abort(404, f"Token {token} doesn't exist or has already been used.")
|
||||||
|
@ -47,7 +47,7 @@ def index():
|
|||||||
created = request.args.get('created')
|
created = request.args.get('created')
|
||||||
|
|
||||||
# this is here to prevent xss
|
# this is here to prevent xss
|
||||||
if not re.match(r"^(cvm|capsul)-[a-z0-9]{10}$", created):
|
if created and not re.match(r"^(cvm|capsul)-[a-z0-9]{10}$", created):
|
||||||
created = '___________'
|
created = '___________'
|
||||||
|
|
||||||
# for now we are going to check the IP according to the virt model
|
# for now we are going to check the IP according to the virt model
|
||||||
|
Loading…
Reference in New Issue
Block a user