Skip to content

Commit

Permalink
fix: url with variable not work (langgenius#12452)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjlarry authored and alexcodelf committed Jan 21, 2025
1 parent 7220da2 commit d2c1193
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions api/core/workflow/nodes/http_request/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ def __init__(
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
Expand All @@ -114,6 +108,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:
Expand Down

0 comments on commit d2c1193

Please sign in to comment.