trailingSlash redirect does not preserve search params for prerendered routes #11138
Labels
pkg:adapter-cloudflare
pkg:adapter-cloudflare-workers
ready to implement
please submit PRs for these issues!
vite
Describe the bug
using
adapter-cloudflare-workers
since@sveltejs/adapter-cloudflare-workers@1.2.1
it now properly redirects trailing slash urls to remove the trailing slash. however, if the page is prerendered, any search params are not preserved in the redirect:example.com/page/?search=params
automatically 308 redirects toexample.com/page
expected behavior (also local dev behavior):
example.com/page/?search=params
should instead automatically 308 redirect toexample.com/page?search=params
quick testing shows
adapter-cloudflare
andadapter-node
behaving the same way, stripping out the query params.the specifics of how search params are intended to be handled in this case are not mentioned in the docs, so i don't know if this is explicitly a bug, but it seems to me to be at the very least inconsistent.
(it created a confusing headache for us when a site began inexplicably losing ad tracking information over the past two weeks due to the update and some legacy ads having made use of trailing slash urls.)
this should be pretty easy to recreate in any project, but i put together a minimal example from a slightly modified version of the sveltekit skeleton app.
Reproduction
https://github.com/matindow/sveltekit-cloudflare-workers-example
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: