mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 20:23:49 +01:00
Update load.ts
This commit is contained in:
parent
b765708041
commit
8b01307afb
@ -59,6 +59,7 @@ function validateUrl(url: string) {
|
||||
const result = tryCreateUrl(url);
|
||||
if (result.pathname.trim('/').length) throw `url="${url}" is not a valid URL, has a pathname.`;
|
||||
if (!url.includes(result.host)) throw `url="${url}" is not a valid URL, has an invalid hostname.`;
|
||||
if (!/^https?:$/.test(result.protocol)) throw `url="${url}" is not a valid URL, has an invalid protocol.`;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user