From 78d2bc7be4306efa341044f0a746e13ca0f74e76 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Tue, 21 Jun 2022 16:39:08 -0400 Subject: [PATCH] Better error message when API key link is available --- app/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/app.py b/app/app.py index 17c595a..25b1367 100644 --- a/app/app.py +++ b/app/app.py @@ -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)