Project

General

Profile

Bug #12724

Net::HTTP#post_form and #get_response do not use ENV proxy as default

Added by aert (Aert van de Hulsbeek) almost 3 years ago. Updated 22 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:77151]

Description

Net::HTTP#post_form and #get_response use HTTP.start, without passing any proxy args to it. As a result, the ENV proxy is not used for these calls.

I believe both calls should have the same default behaviour as the more verbose

   req = Net::HTTP::Post.new(url)
   http = Net::HTTP.new(url.host, url.port)
   req.set_form_data(params)
   response = http.request(req)

which does use the ENV proxy setting.

If this is not desirable, it would be good if this alternate default behaviour can be included in the #post_form and #get_response documentation.

History

Updated by jeremyevans0 (Jeremy Evans) 22 days ago

  • Status changed from Open to Closed

Also available in: Atom PDF