From 46c5bc89eb37a449cea687adc953224928771b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?= Date: Tue, 7 Jan 2025 21:39:46 +0800 Subject: [PATCH 1/2] fix url with variable not work --- api/core/workflow/nodes/http_request/executor.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/api/core/workflow/nodes/http_request/executor.py b/api/core/workflow/nodes/http_request/executor.py index 11842d58b1feee..480e5915719605 100644 --- a/api/core/workflow/nodes/http_request/executor.py +++ b/api/core/workflow/nodes/http_request/executor.py @@ -66,13 +66,7 @@ def __init__( node_data.authorization.config.api_key = variable_pool.convert_template( node_data.authorization.config.api_key ).text - - # check if node_data.url is a valid URL - if not node_data.url: - raise InvalidURLError("url is required") - if not node_data.url.startswith(("http://", "https://")): - raise InvalidURLError("url should start with http:// or https://") - + self.url: str = node_data.url self.method = node_data.method self.auth = node_data.authorization @@ -99,6 +93,12 @@ def _initialize(self): def _init_url(self): self.url = self.variable_pool.convert_template(self.node_data.url).text + # check if url is a valid URL + if not self.url: + raise InvalidURLError("url is required") + if not self.url.startswith(("http://", "https://")): + raise InvalidURLError("url should start with http:// or https://") + def _init_params(self): """ Almost same as _init_headers(), difference: From bffd7067fc84aea22d9ce4c8f8b00e2187b2979b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?= Date: Tue, 7 Jan 2025 21:45:07 +0800 Subject: [PATCH 2/2] fix CI --- api/core/workflow/nodes/http_request/executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/core/workflow/nodes/http_request/executor.py b/api/core/workflow/nodes/http_request/executor.py index 480e5915719605..d14b3f7141d2a2 100644 --- a/api/core/workflow/nodes/http_request/executor.py +++ b/api/core/workflow/nodes/http_request/executor.py @@ -66,7 +66,7 @@ def __init__( node_data.authorization.config.api_key = variable_pool.convert_template( node_data.authorization.config.api_key ).text - + self.url: str = node_data.url self.method = node_data.method self.auth = node_data.authorization