mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-05-04 20:30:39 +00:00
ReqKey check
This commit is contained in:
parent
94f4f74892
commit
5c3cf0a392
2 changed files with 3 additions and 2 deletions
|
@ -135,9 +135,9 @@ def create_app(args):
|
|||
ak = json.get("api_key")
|
||||
else:
|
||||
ak = request.values.get("api_key")
|
||||
|
||||
|
||||
if (
|
||||
api_keys_db.lookup(ak) is None and request.headers.get("Origin") != args.require_api_key_origin
|
||||
api_keys_db.lookup(ak) is None and (request.headers.get("Origin") != args.require_api_key_origin or (args.require_api_key_origin and request.headers.get("ReqKey") != "1"))
|
||||
):
|
||||
abort(
|
||||
403,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue