diff --git a/src/utils.ts b/src/utils.ts index 926efea3..3962a3b7 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -152,12 +152,12 @@ export function joinURL(base: string, ...input: string[]): string { let url = base || ""; for (const segment of input.filter((url) => isNonEmptyURL(url))) { - if (!url) { - url = segment; - } else { + if (url) { // TODO: Handle .. when joining const _segment = segment.replace(JOIN_LEADING_SLASH_RE, ""); url = withTrailingSlash(url) + _segment; + } else { + url = segment; } }