-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Impossible to quote slashes in path parameters #182
Comments
i think current behavior is right. it cause less problems. you can use handler App::handler("/some/path") |
i'll think about this problem. may need to introduce custom decoder for encoded uri |
Well yes, as I said, I understand why the current behavior is useful. But at the same time, from a logical point of view, it's kind of wrong: A URI/URL consists of components separated by (literal) slashes. Therefore, you can't easily use slashes within those components. And that (and other special characters) is the very reason why percent encoding was invented. |
Further thinking about it, the current behavior could even cause bugs: Whenever the contents of the percent-encoded string are provided by the user of the web site (which is often the case), things will break whenever the user enters a '/' in the input box. So, perhaps, the current behavior causes more problems than the old one. |
fixed by a826d11 will release new version later today |
I failed to use a pattern like
route("/some/path/{url}"
where url should match a percent-encoded URL like inhttp://127.0.0.1:8080/some/path/http%3A%2F%2Fexample.com
This fails because the %-encoding is decoded before the pattern is matched, so
%2f
gets expanded to/
and the pattern doesn't match any more.IMHO the fix to #137 in commit 90e3aaa is wrong or incomplete.
I understand it's desirable to be able to directly match on decoded utf-8 characters, but if the decoding is done unconditionally, it makes other use cases like the one mentioned above impossible.
The text was updated successfully, but these errors were encountered: