Skip to content

Automate browser based workflows with AI

support ALLOWED_HOSTS (#1905)

Shuchang Zheng8537a29b1cd8
diff --git a/skyvern/config.py b/skyvern/config.py
index cf9331016..083dcc9df 100644
--- a/skyvern/config.py
+++ b/skyvern/config.py
@@ -40,6 +40,7 @@ class Settings(BaseSettings):
PORT: int = 8000
ALLOWED_ORIGINS: list[str] = ["*"]
BLOCKED_HOSTS: list[str] = ["localhost"]
+ ALLOWED_HOSTS: list[str] = []
# Secret key for JWT. Please generate your own secret key in production
SECRET_KEY: str = "PLACEHOLDER"
diff --git a/skyvern/forge/sdk/core/validators.py b/skyvern/forge/sdk/core/validators.py
index c4e687d32..2882ddb92 100644
--- a/skyvern/forge/sdk/core/validators.py
+++ b/skyvern/forge/sdk/core/validators.py
@@ -29,6 +29,8 @@ def prepend_scheme_and_validate_url(url: str) -> str:
def is_blocked_host(host: str) -> bool:
+ if host.lower() in (h.lower() for h in settings.ALLOWED_HOSTS):
+ return False
try:
ip = ipaddress.ip_address(host)
# Check if the IP is private, link-local, loopback, or reserved