ruby / net-http

Net::HTTP provides a rich library which can be used to build HTTP user-agents.
Other
101 stars 66 forks source link

No test coverage for ipaddr in HTTP.start #188

Open collimarco opened 4 weeks ago

collimarco commented 4 weeks ago

We use a code like this:

request = Net::HTTP::Get.new(uri.request_uri)

Net::HTTP.start(uri.hostname, uri.port, ipaddr: ip, use_ssl: true) do |http|
  http.request(request)
end

What I have noticed is that it is difficult to see if ipaddr is actually used for the request... If there is a change in the future the ipaddr param may be just ignored and nobody will notice.

Furthermore I have noticed that in the code of this gem there is no test coverage for the ipaddr parameter passed to HTTP.start.