forces request query param values to be escaped#162
forces request query param values to be escaped#162DaKaZ wants to merge 3 commits intomgomes:masterfrom
Conversation
lib/api_auth/headers.rb
Outdated
| parsed_uri = URI.parse(uri) | ||
|
|
||
| return parsed_uri.request_uri if parsed_uri.respond_to?(:request_uri) | ||
| uri_without_host = uri.gsub(URI_WITHOUT_HOST_REGEXP, '') |
There was a problem hiding this comment.
what is URI_WITHOUT_HOST_REGEXP ?
| uri.empty? ? '/' : uri | ||
| # Different version of request parsers escape/unescape the param values | ||
| # This will force param values to escaped | ||
| def escape_params(uri) |
There was a problem hiding this comment.
This method is untest and very difficult to understand.
udpates params parsing function and adds tests Corrects error in merge udpates specs
a06e2f5 to
ddfa903
Compare
|
@fwininger I am sorry about that - I had a local helper which I did not include. Please see the new PR code attached which includes several new specs for testing. Note: I had to add Rails as a gemspec dependency since ActiveResource requires it. I am happy to make any changes you see fit, I am just trying to solve a issue affecting multiple people. |
| end | ||
| end | ||
|
|
||
| if RUBY_VERSION.to_f > 2.1 |
There was a problem hiding this comment.
The rest-client will throw an exception for an invalid URI in ruby versions 2.1 and below, I needed this so that all the CI tests would pass. I believe, in later versions the URI is properly escaped rather than throwing the exception but I did not verify in the rest-client code.
|
@fwininger any additional thoughts? |
This PR fixes issue #123 where query strings are handled differently based on combinations of different libraries.