Sha256: 9add358f9e0407a4142f0b034a610d8dfeb5a59abfe0c984aeeb81e44ceda1c4

Contents?: true

Size: 692 Bytes

Versions: 30

Compression:

Stored size: 692 Bytes

Contents

module Faraday
  class Adapter
    class NetHttpNoProxy < Faraday::Adapter::NetHttp
      def net_http_connection(env)
        # Monkey Patch, never use the request to set the proxy settings, let Net::HTTP figure out by itself from
        # the environment variables

        # Original code:
        # if proxy = env[:request][:proxy]
        #   Net::HTTP::Proxy(proxy[:uri].host, proxy[:uri].port, proxy[:user], proxy[:password])
        # else
        #   Net::HTTP
        # end.new(env[:url].host, env[:url].port || (env[:url].scheme == 'https' ? 443 : 80))

        Net::HTTP.new(env[:url].host, env[:url].port || (env[:url].scheme == 'https' ? 443 : 80))
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
mno-enterprise-core-3.4.0 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.3.3 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.3.2 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.2.1 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.3.1 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.3.0 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.2.0 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.1.4 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.0.7 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-2.0.9 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.1.3 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.0.6 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-2.0.8 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.1.2 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.0.5 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-2.0.7 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-2.0.6 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-2.0.5 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.1.1 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.0.4 lib/faraday/adapter/net_http_no_proxy.rb