mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
formatting
This commit is contained in:
parent
ca24dfddb1
commit
93425be839
1 changed files with 5 additions and 11 deletions
|
@ -9,12 +9,12 @@ import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
||||||
import flask
|
import flask
|
||||||
import flask_cors # type: ignore
|
import flask_cors # type: ignore
|
||||||
import time
|
|
||||||
from flask import request
|
from flask import request
|
||||||
from waitress.server import create_server
|
from waitress.server import create_server
|
||||||
|
|
||||||
|
@ -93,10 +93,7 @@ def allroutes(pathin):
|
||||||
try:
|
try:
|
||||||
directory, path = _redirectWebExports(pathin)
|
directory, path = _redirectWebExports(pathin)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return flask.make_response(
|
return flask.make_response(f"Invalid path: {pathin}", HTTPStatus.FORBIDDEN,)
|
||||||
f"Invalid path: {pathin}",
|
|
||||||
HTTPStatus.FORBIDDEN,
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
isdir = os.path.isdir(os.path.join(directory, path))
|
isdir = os.path.isdir(os.path.join(directory, path))
|
||||||
|
@ -153,10 +150,7 @@ def allroutes(pathin):
|
||||||
return flask.send_file(fullpath, mimetype=mimetype, conditional=True)
|
return flask.send_file(fullpath, mimetype=mimetype, conditional=True)
|
||||||
else:
|
else:
|
||||||
print(f"Not found: {pathin}")
|
print(f"Not found: {pathin}")
|
||||||
return flask.make_response(
|
return flask.make_response(f"Invalid path: {pathin}", HTTPStatus.NOT_FOUND,)
|
||||||
f"Invalid path: {pathin}",
|
|
||||||
HTTPStatus.NOT_FOUND,
|
|
||||||
)
|
|
||||||
|
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
if devMode:
|
if devMode:
|
||||||
|
|
Loading…
Reference in a new issue