From 99dc8c7871487d9b8c0669caafb7b93a70bf1956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?= Date: Fri, 7 Mar 2025 12:12:06 +0800 Subject: [PATCH] fix: http node request detect text/xml as file (#15174) --- api/core/workflow/nodes/http_request/entities.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/core/workflow/nodes/http_request/entities.py b/api/core/workflow/nodes/http_request/entities.py index 5764ce725e..1a23171108 100644 --- a/api/core/workflow/nodes/http_request/entities.py +++ b/api/core/workflow/nodes/http_request/entities.py @@ -120,6 +120,10 @@ class Response: if disp_type == "attachment" or filename is not None: return True + # For 'text/' types, only 'csv' should be downloaded as file + if content_type.startswith("text/") and "csv" not in content_type: + return False + # For application types, try to detect if it's a text-based format if content_type.startswith("application/"): # Common text-based application types