Skip to content

Commit

Permalink
fix TrailingSlashIntegration
Browse files Browse the repository at this point in the history
Trailing slash handling was not working correctly on the redirect page.
In case of redirection, the component parameter of astro:build:done is passed
the value of the redirection config as is, so it should be handle the same as
for "index" cases when it ends with a slash.
  • Loading branch information
takemar committed Oct 26, 2023
1 parent ffea055 commit 556cc23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/TrailingSlashIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function trailingSlash(): AstroIntegration {
dedupe(routes)
.filter(
({ component, pathname }) =>
parse(component).name !== "index" && pathname !== "/404"
(parse(component).name !== "index" || component.endsWith("/")) && pathname !== "/404"
)
.map(async ({ pathname }) => {
if (!pathname) return;
Expand Down

0 comments on commit 556cc23

Please sign in to comment.