mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-29 01:18:25 +01:00
Fix bug
C#っぽく使ってしまっていた。
This commit is contained in:
parent
67792fcb5e
commit
c7e8c27ce6
1 changed files with 1 additions and 1 deletions
|
@ -57,7 +57,7 @@ function tryCreateUrl(url: string) {
|
|||
|
||||
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 (result.pathname.replace('/', '').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 a new issue