Remove context check bypass when ANKI_API_PORT set

This resulted in the I/O regression in #3223 not being caught with ./run,
and puts devs ast risk. It also does not currently seem to be required
(pages like graphs and deck options work correctly with ./yarn dev).
I suspect the change was made to support running of pages/*.html, which
we no longer build.
This commit is contained in:
Damien Elmes 2024-06-08 05:16:56 +07:00
parent 71311f201e
commit 847912c5d8

View File

@ -676,6 +676,7 @@ def _check_dynamic_request_permissions():
"Unexpected API access. Please report this message on the Anki forums."
)
print(context, request.headers["Content-type"], request.path)
# check content type header to ensure this isn't an opaque request from another origin
if request.headers["Content-type"] != "application/binary":
aqt.mw.taskman.run_on_main(warn)
@ -685,7 +686,6 @@ def _check_dynamic_request_permissions():
context == PageContext.NON_LEGACY_PAGE
or context == PageContext.EDITOR
or context == PageContext.ADDON_PAGE
or os.environ.get("ANKI_API_PORT")
):
pass
elif context == PageContext.REVIEWER and request.path in (