From 67228c9b267ed6c85044c5bdf74618731cbc1a37 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:55:51 +0800 Subject: [PATCH] fix: url with variable not work (#12452) --- api/core/workflow/nodes/http_request/executor.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/core/workflow/nodes/http_request/executor.py b/api/core/workflow/nodes/http_request/executor.py index 941a0cb078..87b71394e4 100644 --- a/api/core/workflow/nodes/http_request/executor.py +++ b/api/core/workflow/nodes/http_request/executor.py @@ -82,12 +82,6 @@ class Executor: 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 @@ -114,6 +108,12 @@ class Executor: 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: