fix: filter some harmful attrs
parent
275e86a26c
commit
f8f6043be0
@ -0,0 +1,9 @@
|
||||
export const isValidUrl = (url: string): boolean => {
|
||||
try {
|
||||
const parsed_url = new URL(url)
|
||||
return ['http:', 'https:'].includes(parsed_url.protocol)
|
||||
}
|
||||
catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue