mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
parent
8d2e8b1e4f
commit
6ef9ba0305
1 changed files with 5 additions and 1 deletions
|
@ -270,10 +270,14 @@ def _handle_builtin_file_request(request: BundledFileRequest) -> Response:
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
if dev_mode:
|
if dev_mode:
|
||||||
print(f"404: {data_path}")
|
print(f"404: {data_path}")
|
||||||
return flask.make_response(
|
resp = flask.make_response(
|
||||||
f"Invalid path: {path}",
|
f"Invalid path: {path}",
|
||||||
HTTPStatus.NOT_FOUND,
|
HTTPStatus.NOT_FOUND,
|
||||||
)
|
)
|
||||||
|
# we're including the path verbatim in our response, so we need to either use
|
||||||
|
# plain text, or escape HTML characters to reflecting untrusted input
|
||||||
|
resp.headers["Content-type"] = "text/plain"
|
||||||
|
return resp
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
if dev_mode:
|
if dev_mode:
|
||||||
print(
|
print(
|
||||||
|
|
Loading…
Reference in a new issue