Skip to content

fix: exclude Vite requests from trailing slash handling#13095

Merged
ascorbic merged 4 commits intomainfrom
no-slash-vite
Jan 30, 2025
Merged

fix: exclude Vite requests from trailing slash handling#13095
ascorbic merged 4 commits intomainfrom
no-slash-vite

Conversation

@ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Jan 30, 2025

Changes

Skips internal Vite requests when checking trailing slashes

Fixes #13094

Testing

Adding tests now

Docs

@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2025

🦋 Changeset detected

Latest commit: da04d5a

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 Jan 30, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 30, 2025

CodSpeed Performance Report

Merging #13095 will not alter performance

Comparing no-slash-vite (da04d5a) with main (740eb60)

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.

I left a minor nit; it's good nonetheless!

/* malformed uri */
return next(e);
}
if(pathname.startsWith('/_') || pathname.startsWith('/@')) {
Copy link
Member

Choose a reason for hiding this comment

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

I would use @vite to avoid a possible clash with other tools or user-defined endpoints.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's also @id and @fs and possibly others though. The failure mode is to just not show the helpful error page, so I'd rather err on the side of skipping too many

Copy link
Member

Choose a reason for hiding this comment

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

😭

@ascorbic ascorbic merged commit 740eb60 into main Jan 30, 2025
5 checks passed
@ascorbic ascorbic deleted the no-slash-vite branch January 30, 2025 16:04
@astrobot-houston astrobot-houston mentioned this pull request Jan 30, 2025
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.

Redirect to 404 when fetching src files on dev server

3 participants