diff --git a/src/config/load.ts b/src/config/load.ts index 1cec3b148..c0b966d53 100644 --- a/src/config/load.ts +++ b/src/config/load.ts @@ -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;