diff options
| author | mokha <mokha@cisco.com> | 2019-02-06 10:48:53 -0700 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2019-02-06 10:48:53 -0700 |
| commit | f28c0404dfe5d56a770246c3946ce5650ba46e3c (patch) | |
| tree | 1a90a0acba2942a6cbbb3e3c8f18cf7d7391e96c /lib | |
| parent | 7101ff16afe96540446a4256be3d33577a8b9392 (diff) | |
default path to "/"
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/net/hippie/client.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/net/hippie/client.rb b/lib/net/hippie/client.rb index 92b41d3..fb847fc 100644 --- a/lib/net/hippie/client.rb +++ b/lib/net/hippie/client.rb @@ -107,8 +107,9 @@ module Net def request_for(type, uri, headers: {}, body: {}) uri = URI.parse(uri.to_s) + path = uri.path == '' ? '/' : uri.path final_headers = default_headers.merge(headers) - type.new(uri.path, final_headers).tap do |x| + type.new(path || '/', final_headers).tap do |x| x.body = mapper.map_from(final_headers, body) unless body.empty? end end |
