Update SlowAPI and remove hacky HTTP response
This commit is contained in:
6
app.py
6
app.py
@@ -510,9 +510,9 @@ def sanitize_filename(filename: str, base: Path = Path.cwd().resolve()) -> Path:
|
|||||||
async def static(request, fn):
|
async def static(request, fn):
|
||||||
try:
|
try:
|
||||||
path = sanitize_filename(fn, Path("static/").resolve())
|
path = sanitize_filename(fn, Path("static/").resolve())
|
||||||
return (
|
|
||||||
HTTPResponse(request, "", content_type="application/octet-stream")
|
return HTTPResponse(
|
||||||
+ path.read_bytes()
|
request, path.read_bytes(), content_type="application/octet-stream"
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
return HTTPResponse(request, "404 File Not Found", status=404)
|
return HTTPResponse(request, "404 File Not Found", status=404)
|
||||||
|
|||||||
2
libs
2
libs
Submodule libs updated: 014cdd80e2...4e04784f9b
Reference in New Issue
Block a user