diff options
| author | mokha <mokha@cisco.com> | 2018-05-24 16:27:43 -0600 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2018-05-24 16:28:01 -0600 |
| commit | d4b1c5d81bcba19c1092f720b5bd523600c99b3c (patch) | |
| tree | 44dec2a83dadf0f8bded57a785589c3a4d359d3a /lib/net/hippie/client.rb | |
| parent | 08a3bebc663ca31c9f15e6698c78262a94ecae2d (diff) | |
add support for URI::Generic.
Diffstat (limited to 'lib/net/hippie/client.rb')
| -rw-r--r-- | lib/net/hippie/client.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/net/hippie/client.rb b/lib/net/hippie/client.rb index d6638a1..867d79e 100644 --- a/lib/net/hippie/client.rb +++ b/lib/net/hippie/client.rb @@ -67,7 +67,7 @@ module Net def http_for(uri) http = Net::HTTP.new(uri.host, uri.port) http.read_timeout = 30 - http.use_ssl = uri.is_a?(URI::HTTPS) + http.use_ssl = uri.scheme == "https" http.verify_mode = verify_mode http.set_debug_output(Net::Hippie.logger) apply_client_tls_to(http) @@ -76,7 +76,7 @@ module Net def request_for(type, uri, headers: {}, body: {}) final_headers = default_headers.merge(headers) - type.new(uri, final_headers).tap do |x| + type.new(uri.to_s, final_headers).tap do |x| x.body = mapper.map_from(final_headers, body) unless body.empty? end end |
