AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix: Update URL validation to allow non-local domains
Reinier van der Leer84afbf6b45ad
diff --git a/autogpts/autogpt/autogpt/url_utils/validators.py b/autogpts/autogpt/autogpt/url_utils/validators.pyindex 40cc4cb092..0bf4e9240b 100644--- a/autogpts/autogpt/autogpt/url_utils/validators.py+++ b/autogpts/autogpt/autogpt/url_utils/validators.py@@ -86,23 +86,5 @@ def check_local_file_access(url: str) -> bool:"file:///","file://localhost",]- if any(url.startswith(prefix) for prefix in local_file_prefixes):- return True-- # Parse the URL- parsed = urlparse(url)-- # List of local hostnames/IPs without considering ports- local_domains = [- "localhost",- "2130706433", # IP representation of 127.0.0.1- "127.0.0.1",- "0.0.0.0",- "0000" # Not sure what this is for, but keeping it as in original- ]- # Check if the domain part of the URL is in local_domains- if parsed.hostname in local_domains:- return False # We don't restrict localhost access on different ports-- # Return True for anything else that is deemed "local"- return True++ return any(url.startswith(prefix) for prefix in local_file_prefixes)