瀏覽代碼

Fix : Add a process to fetch the mime type from the file name for signed url in remote_url (#10872)

鬼頭拓海 8 月之前
父節點
當前提交
464cc26ccf
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      api/factories/file_factory.py

+ 1 - 0
api/factories/file_factory.py

@@ -169,6 +169,7 @@ def _get_remote_file_info(url: str):
     mime_type = mimetypes.guess_type(url)[0] or ""
     file_size = -1
     filename = url.split("/")[-1].split("?")[0] or "unknown_file"
+    mime_type = mime_type or mimetypes.guess_type(filename)[0]
 
     resp = ssrf_proxy.head(url, follow_redirects=True)
     if resp.status_code == httpx.codes.OK: