Sha256: 9700ef8958fb2fcdded4dac2a248b2ee98c8ef8ea444f82415ba6b213b02137a

Contents?: true

Size: 719 Bytes

Versions: 29

Compression:

Stored size: 719 Bytes

Contents

# frozen_string_literal: true

module HTTPX
  unless ENV.keys.grep(/\Ahttps?_proxy\z/i).empty?
    proxy_session = plugin(:proxy)
    remove_const(:Session)
    const_set(:Session, proxy_session.class)

    # redefine the default options static var, which needs to
    # refresh options_class
    options = proxy_session.class.default_options.to_hash
    options.freeze
    original_verbosity = $VERBOSE
    $VERBOSE = nil
    Options.send(:const_set, :DEFAULT_OPTIONS, options)
    $VERBOSE = original_verbosity
  end

  # :nocov:
  if Session.default_options.debug_level > 2
    proxy_session = plugin(:internal_telemetry)
    remove_const(:Session)
    const_set(:Session, proxy_session.class)
  end
  # :nocov:
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
httpx-0.24.0 lib/httpx/session_extensions.rb
httpx-0.23.4 lib/httpx/session_extensions.rb
httpx-0.23.3 lib/httpx/session_extensions.rb
httpx-0.23.2 lib/httpx/session_extensions.rb
httpx-0.23.1 lib/httpx/session_extensions.rb
httpx-0.23.0 lib/httpx/session_extensions.rb
httpx-0.22.5 lib/httpx/session_extensions.rb
httpx-0.22.4 lib/httpx/session_extensions.rb
httpx-0.22.3 lib/httpx/session_extensions.rb
httpx-0.22.2 lib/httpx/session_extensions.rb
httpx-0.22.1 lib/httpx/session_extensions.rb
httpx-0.22.0 lib/httpx/session_extensions.rb
httpx-0.21.1 lib/httpx/session_extensions.rb
httpx-0.21.0 lib/httpx/session_extensions.rb
httpx-0.20.5 lib/httpx/session_extensions.rb
httpx-0.20.4 lib/httpx/session_extensions.rb
httpx-0.20.3 lib/httpx/session_extensions.rb
httpx-0.20.2 lib/httpx/session_extensions.rb
httpx-0.20.1 lib/httpx/session_extensions.rb
httpx-0.20.0 lib/httpx/session_extensions.rb