-
Notifications
You must be signed in to change notification settings - Fork 58
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
URL escaped paths don't match #32
Comments
Hmm, interesting. I may fix this by adding both escaped and unescaped versions of the URL to the tree, when applicable. I won't be able to do any work on this until next week some time, but will think about it in the meantime. Thanks for the report! |
Yes I was thinking the same (adding both routes to the tree). FWIW the issue doesn't seem to be there for |
Sorry for the delay. Been really busy with work and also moving interstate. But I haven't forgotten about this. I'll be able to get it done some time this month. |
np, thanks for the heads up! |
I have this implemented, still need to write a couple tests. But I remembered that you can tell httptreemux to use r.URL.Path instead of r.RequestURI by setting |
Thanks! yes that might work. Need to understand better how |
My understanding is that URLs generated by On Sat, Jul 30, 2016 at 7:05 AM, Raphaël Simon notifications@github.com
|
So I tried that and it won't work for my use case :( I have slashes in my URLs that need to stay escaped for the route to match. |
Yeah, that is the caveat of using URL.Path. Ok, I'll see about getting the "escape the route" change in this week. :) |
Awesome, thank you! |
This fixes an issue where requests sent by clients would not match routes that contain characters that are escaped by the net/url algorithm used to build URL strings. In particular this affected routes with '*' in them. See dimfeld/httptreemux#32
This fixes an issue where requests sent by clients would not match routes that contain characters that are escaped by the net/url algorithm used to build URL strings. In particular this affected routes with '*' in them. See dimfeld/httptreemux#32
Thank you! |
This fixes an issue where requests sent by clients would not match routes that contain characters that are escaped by the net/url algorithm used to build URL strings. In particular this affected routes with '*' in them. See dimfeld/httptreemux#32
This fixes an issue where requests sent by clients would not match routes that contain characters that are escaped by the net/url algorithm used to build URL strings. In particular this affected routes with '*' in them. See dimfeld/httptreemux#32
Consider the following route:
And the following client code:
Then "oh noes" gets printed. That's because
u.String()
returns:"http://localhost:8080/foo/%2AstarToken"
It seems
httptreemux
is not handling the escape properly. Now it could also be argued that the stdlib is being a bit too generous in its escaping, http://www.rfc-editor.org/rfc/rfc1738.txt states that "*" is OK in URLs but it is what it is...The text was updated successfully, but these errors were encountered: