From 7101ff16afe96540446a4256be3d33577a8b9392 Mon Sep 17 00:00:00 2001 From: mokha Date: Wed, 6 Feb 2019 09:55:24 -0700 Subject: send path instead of full uri. Some servers do not respond well to sending the full path and rely on the path instead. --- lib/net/hippie/client.rb | 3 ++- lib/net/hippie/version.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/net/hippie/client.rb b/lib/net/hippie/client.rb index 8983833..92b41d3 100644 --- a/lib/net/hippie/client.rb +++ b/lib/net/hippie/client.rb @@ -106,8 +106,9 @@ module Net end def request_for(type, uri, headers: {}, body: {}) + uri = URI.parse(uri.to_s) final_headers = default_headers.merge(headers) - type.new(uri.to_s, final_headers).tap do |x| + type.new(uri.path, final_headers).tap do |x| x.body = mapper.map_from(final_headers, body) unless body.empty? end end diff --git a/lib/net/hippie/version.rb b/lib/net/hippie/version.rb index d05f6fe..65ff437 100644 --- a/lib/net/hippie/version.rb +++ b/lib/net/hippie/version.rb @@ -2,6 +2,6 @@ module Net module Hippie - VERSION = '0.2.3' + VERSION = '0.2.4' end end -- cgit v1.2.3