fix: validate URL only if the input type is a URL

This commit is contained in:
Georgios Savvidis 2024-12-17 14:20:07 +01:00 committed by GitHub
parent 67038e1952
commit e2caee695e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -131,12 +131,13 @@ class FetchNode(BaseNode):
return state
# For web sources, validate URL before proceeding
try:
if self.is_valid_url(source):
return self.handle_web_source(state, source)
except ValueError as e:
# Re-raise the exception from is_valid_url
raise
if input_type == "url":
try:
if self.is_valid_url(source):
return self.handle_web_source(state, source)
except ValueError as e:
# Re-raise the exception from is_valid_url
raise
return self.handle_local_source(state, source)