Module: OpenURI

Defined in:
lib/http_proxy_from_env/open_uri.rb

Class Method Summary collapse

Class Method Details

._open_httpObject



5
# File 'lib/http_proxy_from_env/open_uri.rb', line 5

alias :_open_http :open_http

.open_http(buf, target, proxy, options) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/http_proxy_from_env/open_uri.rb', line 8

def self.open_http(buf, target, proxy, options)
  proxy_wrap = proxy
  if proxy_wrap && proxy.first.class == URI::HTTP
    proxy_uri, proxy_user, proxy_pass = proxy
    proxy_wrap = [proxy_uri, proxy_user || proxy_uri.user, proxy_pass || proxy_uri.password]
  end

  _open_http(buf, target, proxy_wrap, options)
end