Skip to content

Commit

Permalink
fix infinite normalize loop (#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Mar 27, 2024
1 parent 3d2e346 commit 1ae59fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1ae59fc

Please sign in to comment.