Skip to content

Commit

Permalink
fix(underscore-redirects): fix dynamic pattern regression (#8979)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderniebuhr authored Nov 1, 2023
1 parent ea16b45 commit 0ee7c9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/cuddly-walls-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/underscore-redirects': patch
---

Fixes a regression which used the wrong pattern for dynamic pages
4 changes: 2 additions & 2 deletions packages/underscore-redirects/src/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ export function createRedirectsFromAstroRoutes({
}
_redirects.add({
dynamic: true,
input: `${base}${route.pattern}`,
input: `${base}${pattern}`,
target,
status: route.type === 'redirect' ? 301 : 200,
weight: 1,
});
} else {
_redirects.add({
dynamic: true,
input: `${base}${route.pattern}`,
input: `${base}${pattern}`,
target: dynamicTarget,
status: 200,
weight: 1,
Expand Down

0 comments on commit 0ee7c9a

Please sign in to comment.