mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Restore ability to check pages externally on other devices
Broken by the recent security changes
This commit is contained in:
parent
aacf8ec774
commit
b23a6af63e
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue