We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 644537b commit c5b9c00Copy full SHA for c5b9c00
pywxdump/api/__init__.py
@@ -73,6 +73,7 @@ async def index():
73
async def serve_file(filename: str):
74
# 构建完整的文件路径
75
file_path = os.path.join(web_path, filename)
76
+ file_path = os.path.abspath(file_path)
77
78
# 检查文件是否存在
79
if os.path.isfile(file_path):
@@ -81,6 +82,7 @@ async def serve_file(filename: str):
81
82
# 如果 MIME 类型为空,则默认为 application/octet-stream
83
if mime_type is None:
84
mime_type = "application/octet-stream"
85
+ server_loger.info(f"[+] 无法获取文件 MIME 类型,使用默认值:{mime_type}")
86
87
# 返回文件
88
return FileResponse(file_path, media_type=mime_type)
0 commit comments