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.
Is there a more "solid" and "future-proof" solution to set the ipaddr in the above code?
Can you add test coverage for this parameter so that it won't break in future versions?
We use a code like this:
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 theipaddr
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 toHTTP.start
.