From 8237421459ca4921be6f6e35bcefea69a2366530 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Wed, 27 Mar 2024 09:17:53 -0700 Subject: [PATCH] fix infinite normalize loop --- src/preview.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/preview.ts b/src/preview.ts index 2d2c84af1..24dfef01f 100644 --- a/src/preview.ts +++ b/src/preview.ts @@ -172,7 +172,7 @@ export class PreviewServer { // Normalize the pathname (e.g., dropping ".html"). const normalizedPathname = config.md.normalizeLink(pathname); - if (pathname !== normalizedPathname) { + if (url.pathname !== normalizedPathname) { res.writeHead(302, {Location: normalizedPathname + url.search}); res.end(); return;