Skip to content

Commit d470e55

Browse files
authored
fix: http node download file always image type (#11319)
1 parent 98a1b01 commit d470e55

File tree

1 file changed

+1
-9
lines changed
  • api/core/workflow/nodes/http_request

1 file changed

+1
-9
lines changed

api/core/workflow/nodes/http_request/node.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import logging
22
from collections.abc import Mapping, Sequence
3-
from mimetypes import guess_extension
4-
from os import path
53
from typing import Any
64

75
from configs import dify_config
8-
from core.file import File, FileTransferMethod, FileType
6+
from core.file import File, FileTransferMethod
97
from core.tools.tool_file_manager import ToolFileManager
108
from core.workflow.entities.node_entities import NodeRunResult
119
from core.workflow.entities.variable_entities import VariableSelector
@@ -150,11 +148,6 @@ def extract_files(self, url: str, response: Response) -> list[File]:
150148
content = response.content
151149

152150
if is_file and content_type:
153-
# extract filename from url
154-
filename = path.basename(url)
155-
# extract extension if possible
156-
extension = guess_extension(content_type) or ".bin"
157-
158151
tool_file = ToolFileManager.create_file_by_raw(
159152
user_id=self.user_id,
160153
tenant_id=self.tenant_id,
@@ -165,7 +158,6 @@ def extract_files(self, url: str, response: Response) -> list[File]:
165158

166159
mapping = {
167160
"tool_file_id": tool_file.id,
168-
"type": FileType.IMAGE.value,
169161
"transfer_method": FileTransferMethod.TOOL_FILE.value,
170162
}
171163
file = file_factory.build_from_mapping(

0 commit comments

Comments
 (0)