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
Handle multiple slashes in url #10989
Comments
I believe this is a known limitation because we can't translate |
Is there no way to get the original request with raw initial URL somewhere in Astro? Would that mean that the only way to accomplish that is to put a reverse-proxy in front of Astro where the URL gets sanitized? One reason for sanitizing URLs is for SEO. Google might think of '/path///other' and /path/other' as two separate things potentially leading to duplicate content. |
This is SSR so I wouldn't expect it to have that constraint. Did you debug to see where it gets stripped away? |
Looks like this was caused by this: #7935 In retrospect I think this PR was a mistake. @DarthTicius would you be interested in submitting a PR to fix? |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
We want to redirect user if url contains multiple slashes
https://www.example.com/this//is/my/////directory
tohttps://www.example.com/this/is/my/directory
But on the middleware side we do not get raw url :
https://www.example.com/this//is/my/////directory
instead we are getting already sanitized version
https://www.example.com/this/is/my/directory.
What's the expected result?
Expecting the url in client to be sanitized and not remaining
https://www.example.com/this//is/my/////directory
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-tdbrwm?file=src%2Fmiddleware.ts
Participation
The text was updated successfully, but these errors were encountered: