Skip to content

Conversation

@dreyfus92
Copy link
Member

@dreyfus92 dreyfus92 commented Apr 10, 2025

Changes

Closes: #13585

  • What does this change?

Fixes routing with base paths when trailingSlash is set to 'never', ensuring requests to '/base' are correctly matched when the base path is set to '/base'. The fix also maintains compatibility with rewrites, with all rewrite tests passing successfully.

Testing

I've added 2 🤏🏻 tests 🫡

Docs

@changeset-bot
Copy link

changeset-bot bot commented Apr 10, 2025

🦋 Changeset detected

Latest commit: 2bf97ac

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Apr 10, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 10, 2025

CodSpeed Performance Report

Merging #13598 will not alter performance

Comparing dreyfus92:patch/trailing-slash (2bf97ac) with main (a0774b3)

Summary

✅ 6 untouched benchmarks

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailingSlash strikes again! Thank you for the fix @dreyfus92

@ematipico ematipico merged commit f5de51e into withastro:main Apr 15, 2025
15 of 16 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Apr 15, 2025
openscript pushed a commit to openscript/astro that referenced this pull request Sep 12, 2025
…ion (withastro#13598)

* fix(routing): handle base path with trailing slash 'never' configuration

* fix: changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Astro.url.pathname returns trailing slash on index page when base is set and trailingSlash is 'never'

2 participants