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

fileserver: Preserve query during canonicalization redirect #6109

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

francislavoie
Copy link
Member

Replaces #5254

Context: https://caddy.community/t/caddy-stripping-querystring/22754

When a canonicalization redirect happens, it's only taking the path and adding a /, which loses the original query if there was one.

This preserves it safely, without making additional modifications to the URL.

@francislavoie francislavoie added the bug 🐞 Something isn't working label Feb 15, 2024
@francislavoie francislavoie added this to the v2.8.0 milestone Feb 15, 2024
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Nice -- I this is a simple fix, assuming to consists solely of a path (or at least, doesn't have a query string). (I wonder if we should add a comment somewhere to mention that?)

@francislavoie
Copy link
Member Author

Yeah we only ever use it with the path currently, so it's fine. I'll add a comment.

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.

None yet

2 participants