mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
fix some warnings on startup
This commit is contained in:
parent
e3c9502b46
commit
a61f3bbc48
2 changed files with 12 additions and 6 deletions
|
@ -20,11 +20,12 @@ def _build_info_path() -> str:
|
|||
|
||||
def _get_build_info() -> Dict[str, str]:
|
||||
info = {}
|
||||
for line in open(_build_info_path()).readlines():
|
||||
elems = line.split()
|
||||
if len(elems) == 2:
|
||||
k, v = elems
|
||||
info[k] = v
|
||||
with open(_build_info_path()) as file:
|
||||
for line in file.readlines():
|
||||
elems = line.split()
|
||||
if len(elems) == 2:
|
||||
k, v = elems
|
||||
info[k] = v
|
||||
|
||||
return info
|
||||
|
||||
|
|
|
@ -64,7 +64,12 @@ class MediaServer(threading.Thread):
|
|||
logging.getLogger("waitress").setLevel(logging.ERROR)
|
||||
|
||||
desired_port = int(os.getenv("ANKI_API_PORT", "0"))
|
||||
self.server = create_server(app, host="127.0.0.1", port=desired_port)
|
||||
self.server = create_server(
|
||||
app,
|
||||
host="127.0.0.1",
|
||||
port=desired_port,
|
||||
clear_untrusted_proxy_headers=True,
|
||||
)
|
||||
if devMode:
|
||||
print(
|
||||
"Serving on http://%s:%s"
|
||||
|
|
Loading…
Reference in a new issue