Skip to content

Commit

Permalink
Merge pull request #204 from pweldon/excon_set_request_hostname
Browse files Browse the repository at this point in the history
Set both :host, and :hostname options on excon connection to avoid warning.
  • Loading branch information
rogerleite authored Jul 7, 2020
2 parents 97121c6 + 84ae769 commit 9a73b7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/httpi/adapter/excon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def client_opts

opts = {
:host => url.host,
:hostname => url.hostname,
:path => url.path,
:port => url.port,
:query => url.query,
Expand Down
6 changes: 6 additions & 0 deletions spec/httpi/adapter/excon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9a73b7f

Please sign in to comment.