Skip to content

Fix query params being empty #774

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

Merged
merged 2 commits into from
Mar 31, 2021
Merged

Fix query params being empty #774

merged 2 commits into from
Mar 31, 2021

Conversation

wiesson
Copy link
Contributor

@wiesson wiesson commented Mar 30, 2021

Fixes #631

The query params are not parsed correctly, because URL does not return query - instead it returns the desired searchParams!

Tested here - https://sveltekit-vercel.vercel.app/queryparams?q=pizza

@wiesson
Copy link
Contributor Author

wiesson commented Mar 30, 2021

The previous job was successful, I could imagine that somekind of race condition happened because I force pushed to the branch 🤷‍♂️

https://github.com./sveltejs/kit/actions/runs/701770695

@benmccann
Copy link
Member

If this is broken, then I'm guessing adapter-node might be as well:

query: new URLSearchParams(parsed.query || '')

Strange that this would only be reported now...

@benmccann
Copy link
Member

Ah, nevermind. adapter-node calls parse which returns a legacy URL which defines query. We should probably change adapter-node as well so that it doesn't use the legacy URL creation method

@wiesson
Copy link
Contributor Author

wiesson commented Mar 31, 2021

Should I include that in this PR as well or create a new one?

@benmccann
Copy link
Member

I've updated this PR

@benmccann benmccann merged commit ca33a35 into sveltejs:master Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query params are not available within load function with adapter-vercel
3 participants