Skip to content
Snippets Groups Projects
Commit 78d2bc7b authored by Piero Toffanin's avatar Piero Toffanin
Browse files

Better error message when API key link is available

parent 47fc85fd
No related branches found
No related tags found
No related merge requests found
......@@ -195,9 +195,12 @@ def create_app(args):
and api_keys_db.lookup(ak) is None
and request.headers.get("Origin") != args.require_api_key_origin
):
description = "Please contact the server operator to get an API key"
if args.get_api_key_link:
description = "Visit %s to get an API key" % args.get_api_key_link
abort(
403,
description="Please contact the server operator to obtain an API key",
description=description,
)
return f(*a, **kw)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment