Skip to content

Commit

Permalink
fix redirect middleware index bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Walker-GM committed Jun 19, 2024
1 parent 7d64e29 commit d78e198
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/middleware/redirects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export async function middleware(
// Static redirects
const froms = REDIRECTS.map((r) => r.from)
const index = froms.indexOf(url.pathname)
if (index) {
if (index !== -1) {
const { to, status } = REDIRECTS[index]
mwResponse.status = status
mwResponse.headers.set('Location', to)
Expand Down

0 comments on commit d78e198

Please sign in to comment.