From a934397961f15ee0e07a43125e20bd26f7125be6 Mon Sep 17 00:00:00 2001 From: Anton Bulakh Date: Tue, 31 Dec 2024 04:21:07 +0200 Subject: [PATCH] fix(spa): Fix relative alias redirects (#1688) --- quartz/components/scripts/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quartz/components/scripts/util.ts b/quartz/components/scripts/util.ts index c1db8ba..ff486cf 100644 --- a/quartz/components/scripts/util.ts +++ b/quartz/components/scripts/util.ts @@ -41,5 +41,5 @@ export async function fetchCanonical(url: URL): Promise { // to allow the caller to read it if it's was not a redirect const text = await res.clone().text() const [_, redirect] = text.match(canonicalRegex) ?? [] - return redirect ? fetch(redirect) : res + return redirect ? fetch(`${new URL(redirect, url)}`) : res }