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.

feat: replace file content type to avoid load script in svg. (#16454)

-LAN-ac910ed200c7
diff --git a/api/controllers/files/image_preview.py b/api/controllers/files/image_preview.py
index 6f39908b6e5..5adfe16a799 100644
--- a/api/controllers/files/image_preview.py
+++ b/api/controllers/files/image_preview.py
@@ -75,6 +75,7 @@ class FilePreviewApi(Resource):
if args["as_attachment"]:
encoded_filename = quote(upload_file.name)
response.headers["Content-Disposition"] = f"attachment; filename*=UTF-8''{encoded_filename}"
+ response.headers["Content-Type"] = "application/octet-stream"
return response