block urls pointing to internal addresses (#1012)

This commit is contained in:
Shuchang Zheng
2024-10-20 18:33:05 -07:00
committed by GitHub
parent b31b77707c
commit 3e40267cfa
4 changed files with 41 additions and 2 deletions

View File

@@ -502,3 +502,11 @@ class InvalidUrl(SkyvernHTTPException):
super().__init__(
f"Invalid URL: {url}. Skyvern supports HTTP and HTTPS urls.", status_code=status.HTTP_400_BAD_REQUEST
)
class BlockedHost(SkyvernHTTPException):
def __init__(self, host: str) -> None:
super().__init__(
f"The host in your url is blocked: {host}",
status_code=status.HTTP_400_BAD_REQUEST,
)