7 Commits

Author SHA1 Message Date
YueGuobin
952ef66a6b
fix: handle directory access for static web-ui routes
When accessing /static/web-ui without trailing slash, the request would
fail with "RuntimeError: File at path ... is not a file" because:

1. The route /static/web-ui/{file_path:path} doesn't match paths without
   trailing slash (Starlette's path regex requires the /)
2. The request falls through to StaticFiles mount, which tries to serve
   the directory as a file

This fix:
- Sets html=True on StaticFiles mount to automatically redirect directory
  URLs to trailing slash versions
- Adds os.path.isdir() check to handle empty file_path gracefully

Fixes #2680

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 17:21:03 +08:00
UmmmAGoodName
6ff4d46838 Fixed the path traversal check 2026-03-05 16:38:55 +01:00
grossmj
47a7324eb5
Fix tests 2026-02-25 19:00:57 +08:00
grossmj
0ee73605c0
Configure self-hosting JavaScript and CSS for docs 2024-12-19 16:54:11 +07:00
grossmj
19de2732f2 Upgrade to FastAPI 0.85.0 and check embedded web-ui index.html can be found. 2022-09-29 15:11:15 +02:00
grossmj
c021e21309 Use black with -l 120 param. 2021-04-13 18:46:50 +09:30
grossmj
c043830e3f Move endpoints to routes & preparations to use a database. 2020-11-19 15:21:03 +10:30