fix: return 400 for invalid protocols and unresolvable hostnames (was 500)
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 9m41s

This commit is contained in:
OpenClawd 2026-02-24 14:00:55 +00:00
parent 5ec8c92413
commit b07b9cfd25
3 changed files with 3 additions and 3 deletions

View file

@ -39,7 +39,7 @@ export async function validateUrl(urlStr: string): Promise<{ hostname: string; r
}
if (!["http:", "https:"].includes(parsed.protocol)) {
throw new Error("Only HTTP and HTTPS URLs are allowed");
throw new Error("URL protocol not allowed: only HTTP and HTTPS are supported");
}
const hostname = parsed.hostname;