Commit 8c220c7d authored by Tiago's avatar Tiago
Browse files

proxy: unescape user/password values for proxy options

when the values from from proxy uri and are parsed by URI, these values will be percent-encoded, which may generate the wrong value when encoded back by any of the authorization methods
parent 7a6aeb54
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

module HTTPX
  module Plugins
    # https://gitlab.com/os85/httpx/wikis/Auth#ntlm-auth
    # https://gitlab.com/os85/httpx/wikis/Auth#ntlm-v2-auth
    module NtlmV2Auth
      class << self
        def load_dependencies(klass)
+5 −0
Original line number Diff line number Diff line
# frozen_string_literal: true

require "cgi"

module HTTPX
  class ProxyError < ConnectionError; end

@@ -65,6 +67,9 @@ module HTTPX

          return unless @scheme

          @username = CGI.unescape(@username) if @username
          @password = CGI.unescape(@password) if @password

          @authenticator = load_authenticator(@scheme, @username, @password, **extra)
        end