fix
This commit is contained in:
parent
91b7aa34cb
commit
e75465d93c
@ -83,6 +83,8 @@ def gen_fastapi_app():
|
||||
if mime_type is None:
|
||||
mime_type = "application/octet-stream"
|
||||
server_loger.info(f"[+] 无法获取文件 MIME 类型,使用默认值:{mime_type}")
|
||||
if file_path.endswith(".js"):
|
||||
mime_type = "text/javascript"
|
||||
server_loger.info(f"[+] 文件 {file_path} MIME 类型:{mime_type}")
|
||||
# 返回文件
|
||||
return FileResponse(file_path, media_type=mime_type)
|
||||
|
Loading…
Reference in New Issue
Block a user