Skip to content

Commit 059e102

Browse files
committed
fix: use normalized path properly
The const was being created but not used. Fix to use and it should redirect for path either with or without the trailing slash.
1 parent 940b5e6 commit 059e102

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

static/index.en.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ app.use(async (ctx, next) => {
5757
"/disposal-and-recycling": "https://esolia.co.jp/en/services/infrastructure/disposal-and-recycling/",
5858
};
5959

60-
if (redirects[path]) {
61-
ctx.response.redirect(redirects[path]);
60+
if (redirects[normalizedPath]) {
61+
ctx.response.redirect(redirects[normalizedPath]);
6262
ctx.response.status = 301;
6363
return; // Stop processing, don't call next()
6464
}

0 commit comments

Comments
 (0)