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

Wrongly parsing space / + #16

Closed
spruce opened this issue Nov 20, 2020 · 0 comments · Fixed by #17
Closed

Wrongly parsing space / + #16

spruce opened this issue Nov 20, 2020 · 0 comments · Fixed by #17

Comments

@spruce
Copy link
Contributor

spruce commented Nov 20, 2020

Hello,

i have an input filed which should be send to the server for filtering which can be entered by an user.
when he types some words+ (a little contrieved, i know, but still possible) Google Chrome generates the following request to the server:
https://server/api/endpoint?filter%5Bquery%5D=some+words%2B&page%5Bsize%5D=100 Which looks fine to me.
When parsing the querystring it gives the following result:
Ok(Object({"filter": Object({"query": String("some+words+")}), "page": Object({"size": String("100")})}))

In this Object the real plus is indistinguishable from the plus as space character.

This probably stems from first calling url::percent_decode and then using its own parse_pairs instead of directly using https://docs.rs/url/1.7.2/url/struct.Url.html#method.query_pairs

I try an create a failing test in a PR and fix the problem later.

(There apparently is a difference between decoding a url and getting the query_params as pairs which has to do with if the parser is in urlformdecode mode or not. Don't Ask me)

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 a pull request may close this issue.

1 participant