1
0

feat(webhooks): add form validation

This commit is contained in:
kolaente
2023-10-20 12:32:46 +02:00
parent 3d2fe4cf65
commit 779aad1b2d
3 changed files with 48 additions and 4 deletions

View File

@ -0,0 +1,11 @@
export function isValidHttpUrl(urlToCheck: string): boolean {
let url
try {
url = new URL(urlToCheck)
} catch (_) {
return false
}
return url.protocol === 'http:' || url.protocol === 'https:'
}