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-2.0.4 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.1.0 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.0.3 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-2.0.3 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.0.2 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-2.0.2 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.0.1 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-2.0.1 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-3.0.0 lib/faraday/adapter/net_http_no_proxy.rb
mno-enterprise-core-2.0.0 lib/faraday/adapter/net_http_no_proxy.rb