Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

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

鬼頭拓海af53e2b6b086
diff --git a/api/factories/file_factory.py b/api/factories/file_factory.py
index 8cb45f194b0..4da0140d19a 100644
--- a/api/factories/file_factory.py
+++ b/api/factories/file_factory.py
@@ -166,10 +166,9 @@ def _build_from_remote_url(
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]
+ mime_type = mimetypes.guess_type(filename)[0] or ""
resp = ssrf_proxy.head(url, follow_redirects=True)
if resp.status_code == httpx.codes.OK: