Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore trailing slash for endpoints with file extensions #13131

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Feb 3, 2025

Changes

#13111 removed special handling for endpoint trailing slashes, because they broke trailignSlash=always. However this caused a regression for endpoints that include a file extension. This PR changes the handling for endpoints that include a file extension, to always use trailingSlash: "ignore". This means it will match with and without the extension. I've done it liek this rather than setting to never, because that would be a breakign change. Currently file-based endpoints do obey trailing slash rules, even with file extensions. This is probably a mistake (who wants /sitemap.xml/), but some may rely on it so we'll move any change to Astro 6.

Fixes #13128

Testing

Adds tests

Docs

Copy link

changeset-bot bot commented Feb 3, 2025

🦋 Changeset detected

Latest commit: e63ae5d

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 Feb 3, 2025
Copy link

codspeed-hq bot commented Feb 3, 2025

CodSpeed Performance Report

Merging #13131 will not alter performance

Comparing trailing-ext (e63ae5d) with main (2a85bd7)

Summary

✅ 6 untouched benchmarks

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.

Injected endpoint with dots in pattern should no follow trailingSlash: always
2 participants