feat: surface validation feedback in playground UI

This commit is contained in:
CREDO23 2026-07-23 18:52:50 +02:00
parent 1ad8efb658
commit 15962d205f
4 changed files with 63 additions and 5 deletions

View file

@ -12,3 +12,13 @@ export function tryGetHostname(url: string): string | undefined {
return undefined;
}
}
/** True when the value parses as an http(s) URL — mirrors the backend's boundary rule. */
export function isHttpUrl(value: string): boolean {
try {
const { protocol } = new URL(value);
return protocol === "http:" || protocol === "https:";
} catch {
return false;
}
}