Restore ability to check pages externally on other devices

Broken by the recent security changes
This commit is contained in:
Damien Elmes 2025-04-24 18:32:55 +10:00
parent aacf8ec774
commit b23a6af63e

View file

@ -768,7 +768,10 @@ _APIKEY = "".join(random.choices(string.ascii_letters + string.digits, k=32))
def _have_api_access() -> bool: def _have_api_access() -> bool:
return request.headers.get("Authorization") == f"Bearer {_APIKEY}" return (
request.headers.get("Authorization") == f"Bearer {_APIKEY}"
or os.environ.get("ANKI_API_HOST") == "0.0.0.0"
)
# this currently only handles a single method; in the future, idempotent # this currently only handles a single method; in the future, idempotent