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;