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):
|
||||
try:
|
||||
path = sanitize_filename(fn, Path("static/").resolve())
|
||||
return (
|
||||
HTTPResponse(request, "", content_type="application/octet-stream")
|
||||
+ path.read_bytes()
|
||||
|
||||
return HTTPResponse(
|
||||
request, path.read_bytes(), content_type="application/octet-stream"
|
||||
)
|
||||
except Exception:
|
||||
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