diff --git a/lib/httpi/adapter/excon.rb b/lib/httpi/adapter/excon.rb index 1570526..4821696 100644 --- a/lib/httpi/adapter/excon.rb +++ b/lib/httpi/adapter/excon.rb @@ -41,6 +41,7 @@ def client_opts opts = { :host => url.host, + :hostname => url.hostname, :path => url.path, :port => url.port, :query => url.query, diff --git a/spec/httpi/adapter/excon_spec.rb b/spec/httpi/adapter/excon_spec.rb index e26ab32..46fbc80 100644 --- a/spec/httpi/adapter/excon_spec.rb +++ b/spec/httpi/adapter/excon_spec.rb @@ -23,6 +23,12 @@ ) end end + describe "host, hostname" do + it "both are set" do + Excon.expects(:display_warning).never + expect(adapter.client.data).to include(host: 'example.com', hostname: 'example.com') + end + end end end end