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(node): fix unexpected extra equals sign in HTTP params (#23474)

ghmark675ad61b4249417
diff --git a/api/core/workflow/nodes/http_request/executor.py b/api/core/workflow/nodes/http_request/executor.py
index 2106369bd64..e45f63bbecc 100644
--- a/api/core/workflow/nodes/http_request/executor.py
+++ b/api/core/workflow/nodes/http_request/executor.py
@@ -91,7 +91,7 @@ class Executor:
self.auth = node_data.authorization
self.timeout = timeout
self.ssl_verify = node_data.ssl_verify
- self.params = []
+ self.params = None
self.headers = {}
self.content = None
self.files = None
@@ -139,7 +139,8 @@ class Executor:
(self.variable_pool.convert_template(key).text, self.variable_pool.convert_template(value_str).text)
)
- self.params = result
+ if result:
+ self.params = result
def _init_headers(self):
"""
diff --git a/api/tests/unit_tests/core/workflow/nodes/http_request/test_http_request_executor.py b/api/tests/unit_tests/core/workflow/nodes/http_request/test_http_request_executor.py
index bb6d72f51e5..3101f7dd349 100644
--- a/api/tests/unit_tests/core/workflow/nodes/http_request/test_http_request_executor.py
+++ b/api/tests/unit_tests/core/workflow/nodes/http_request/test_http_request_executor.py
@@ -49,7 +49,7 @@ def test_executor_with_json_body_and_number_variable():
assert executor.method == "post"
assert executor.url == "https://api.example.com/data"
assert executor.headers == {"Content-Type": "application/json"}
- assert executor.params == []
+ assert executor.params is None
assert executor.json == {"number": 42}
assert executor.data is None
assert executor.files is None
@@ -102,7 +102,7 @@ def test_executor_with_json_body_and_object_variable():
assert executor.method == "post"
assert executor.url == "https://api.example.com/data"
assert executor.headers == {"Content-Type": "application/json"}
- assert executor.params == []
+ assert executor.params is None
assert executor.json == {"name": "John Doe", "age": 30, "email": "[email protected]"}
assert executor.data is None
assert executor.files is None
@@ -157,7 +157,7 @@ def test_executor_with_json_body_and_nested_object_variable():
assert executor.method == "post"
assert executor.url == "https://api.example.com/data"
assert executor.headers == {"Content-Type": "application/json"}
- assert executor.params == []
+ assert executor.params is None
assert executor.json == {"object": {"name": "John Doe", "age": 30, "email": "[email protected]"}}
assert executor.data is None
assert executor.files is None
@@ -245,7 +245,7 @@ def test_executor_with_form_data():
assert executor.url == "https://api.example.com/upload"
assert "Content-Type" in executor.headers
assert "multipart/form-data" in executor.headers["Content-Type"]
- assert executor.params == []
+ assert executor.params is None
assert executor.json is None
# '__multipart_placeholder__' is expected when no file inputs exist,
# to ensure the request is treated as multipart/form-data by the backend.