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

Bugfix for trailing slash redirects when using pathPrefix option. #64

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

petershafer
Copy link
Contributor

Redirects implemented in the dev server will add or remove a trailing slash to the path depending on the resource requested at /{path} and the existence of /{path}/index.html or /{path}.html.

These redirects do not account for use of the pathPrefix option and will result in a request to /{prefix}/{path} redirecting to /{path}/ when /{prefix}/{path}/index.html exists.

Similarly, a request to /{prefix}/index/ when /{prefix}/index.html exists will result in a redirect to /index.

The solution I've proposed is to re-use the original path when redirecting in these cases, which will retain the pathPrefix portion of the path.

@zachleat
Copy link
Member

Shipping with v2.0.0

@zachleat zachleat added the bug Something isn't working label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants