Fix require-api-key-origin logic

This commit is contained in:
Piero Toffanin 2023-03-07 09:16:55 -05:00
parent 01a99b3d3e
commit 11ec67663d

View file

@ -243,7 +243,7 @@ def create_app(args):
elif ( elif (
args.require_api_key_origin args.require_api_key_origin
and api_keys_db.lookup(ak) is None and api_keys_db.lookup(ak) is None
and not re.match(args.require_api_key_origin, request.headers.get("Origin")) and not re.match(args.require_api_key_origin, request.headers.get("Origin", ""))
): ):
description = _("Please contact the server operator to get an API key") description = _("Please contact the server operator to get an API key")
if args.get_api_key_link: if args.get_api_key_link: