-
Notifications
You must be signed in to change notification settings - Fork 105
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
Problem: routing url-encoded URLs doesn't work properly #173
Conversation
Apparently, it is impossible to specify some more involved JMESPath expressions, for example, ones that would contain `?contains` or a slash in them. Solution: make sure both frontend use percent encoding The reason for this malfunction is that, firstly, the frontend part didn't encode the URL components being 1) sent to the server 2) updated in the location of the page. Secondly, the backend's library for handling HTTP (rouille) eagerly decoded URLs thus rendering it impossible to match on these values as `?` or `/` would trigger stops. A forked version of roulle is used now. If the [pull request](tomaka/rouille#173) will be accepted, can switch back at that time.
Thanks, looks good! Please also add am entry in the changelog and I'll merge. |
The URL is being decoded before any matching is done. So, for example, `/hello/%3Fa` will not match `/hello/a` because `%3F` is already decoded to `?`. Solution: use raw URL to do the routing and decode individual parts instead.
Updated the changelog. |
@tomaka Hi Pierre, what's the ETA for the next release? I am running into vendoring/frozen builds issues packaging my app for NixOS -- I am yet to see a workaround for git-based dependencies in their process. In the meantime, the only solid way for things to work is to depend on crates.io-only packages. Hence the question about the next release! Thanks. |
@yrashk If you submit a PR that bumps the version in Cargo.toml and CHANGELOG, it will automatically be published once merged. |
Awesome, will do!
…On Mon, Mar 5, 2018, 8:46 PM Pierre Krieger ***@***.***> wrote:
@yrashk <https://github.com/yrashk> If you submit a PR that bumps the
version in Cargo.toml and CHANGELOG, it will automatically be published
once merged.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#173 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAABxOhEefQVn4GGArqldAo14JOMdVBFks5tbUG4gaJpZM4SOwzd>
.
|
Apparently, it is impossible to specify some more involved JMESPath expressions, for example, ones that would contain `?contains` or a slash in them. Solution: make sure both frontend use percent encoding The reason for this malfunction is that, firstly, the frontend part didn't encode the URL components being 1) sent to the server 2) updated in the location of the page. Secondly, the backend's library for handling HTTP (rouille) eagerly decoded URLs thus rendering it impossible to match on these values as `?` or `/` would trigger stops. A forked version of roulle is used now. If the [pull request](tomaka/rouille#173) will be accepted, can switch back at that time.
The URL is being decoded before any matching is done.
So, for example,
/hello/%3Fa
will not match/hello/a
because%3F
is already decoded to
?
.Solution: use raw URL to do the routing and decode individual parts
instead.