Skip to content

Preserve query params in StaticFileHandler redirects #15789

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

syeopite
Copy link
Contributor

Closes #15788

Preserve query parameters when HTTP::StaticFileHandler performs a redirect

http://localhost:12345//route?k=v --> http://localhost:12345/route?k=v


I can't actually confirm if the specs itself pass because I'm not able to build std_spec locally for some reason. But it works correctly when running the same code on an isolated script with a locally built compiler.

@straight-shoota
Copy link
Member

If you cannot build std_spec, maybe you can run just bin/crystal spec spec/std/http/server/handlers/static_file_handler_spec.cr?

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:networking labels May 19, 2025
@syeopite
Copy link
Contributor Author

If you cannot build std_spec, maybe you can run just bin/crystal spec spec/std/http/server/handlers/static_file_handler_spec.cr?

Yeah that works.

I managed to also get std_spec working as well after installing lld so thankfully (well depending on how you look at it) the culprit was just due to issue 13193.

@syeopite syeopite requested a review from straight-shoota May 27, 2025 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:networking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redirects in HTTP::StaticFileHandler does not preserve a request's query parameters
2 participants