From a448fc43ae07e1518b0a8b1d929b3a71e5bd820e Mon Sep 17 00:00:00 2001 From: arabcoders Date: Sat, 5 Jul 2025 18:15:37 +0300 Subject: [PATCH] cast file to string for mimetype --- app/routes/api/_static.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes/api/_static.py b/app/routes/api/_static.py index e1d70068..2f976420 100644 --- a/app/routes/api/_static.py +++ b/app/routes/api/_static.py @@ -100,7 +100,7 @@ def preload_static(root_path: Path, config: Config) -> None: # uri_path: str = f"/{str(file.as_posix()).replace(f'{static_dir.as_posix()!s}/', '')}" contentType = EXT_TO_MIME.get(file.suffix) if not contentType: - contentType = MIME.from_file(file) + contentType = MIME.from_file(str(file)) STATIC_FILES[uri_path] = { "uri": uri_path,