From 11ec67663d6f610bfb26f649102faebc1cabbb5b Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Tue, 7 Mar 2023 09:16:55 -0500 Subject: [PATCH] Fix require-api-key-origin logic --- libretranslate/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretranslate/app.py b/libretranslate/app.py index 4706abd..21f9095 100644 --- a/libretranslate/app.py +++ b/libretranslate/app.py @@ -243,7 +243,7 @@ def create_app(args): elif ( args.require_api_key_origin 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") if args.get_api_key_link: