-
Notifications
You must be signed in to change notification settings - Fork 323
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
Not percent encoding colons in query parameters #246
Comments
Fix was applied to 0-8-stable branch. Will try to fix tests (fails on travis but not locally and not related to fix itself) and will cut |
What about 0.9.0? |
@tarcieri Stupid me. By some reason I wanted to apply patch to 0.8.x and then add it to 0.9.x; Will apply patch to 0.9 now as specs will pass so it will become available as 0.9.1 release. |
0.9.1 and 0.8.13 fixes issue now. |
I am just testing this out now and I don't actually get encoded colons in my real web request.
|
@ixti Thanks for the quick response. Have you seen my comment above? |
@thomas-holmes Sorry. Overlooked. Will check ASAP. |
Hm. Found the issue: # https://github.com/httprb/http/blob/master/lib/http/request.rb#L69
query = HTTP::URI.form_encode(:t => Time.now.iso8601)
# => "t=2015-08-19T00%3A21%3A20%2B02%3A00"
uri = HTTP::URI.parse("http://google.com/?#{query}")
# => #<Addressable::URI:0x1802c48 URI:http://google.com/?t=2015-08-19T00%3A21%3A20%2B02%3A00>
uri.normalize
# => #<Addressable::URI:0x181206c URI:http://google.com/?t=2015-08-19T00:21:20%2B02:00> I remember I have added |
Thanks again :) |
@thomas-holmes Please check with
|
@ixti It looks like it works for my use case! Thanks so much for your help :) |
@thomas-holmes thanks for report! :D |
Colons in query parameters are not getting properly encoded. I ran into this while passing ISO8601 formatted timestamps in query strings with the twitter API.
While their documentation does not specify needing to encode the colon for oauth signing, simple_oauth appears to (probably correctly, since the URI specification says the colon should be percent encoded) use the encoded value when generating the oauth signature value.
The resulting behavior is an oauth hmac signature mismatch due to the final URL that is used does not have the query param colons percent encoded.
This behavior changed starting with version 0.8.
ref: sferik/twitter-ruby#687
The text was updated successfully, but these errors were encountered: