lib/httpclient/auth.rb
# Filter API implementation.  Traps HTTP response and parses
# 'Proxy-Authenticate' header.
Filter API implementation.  Traps HTTP response and parses
'Proxy-Authenticate' header.
Filter API implementation . Traps HTTP response and parses ' Proxy - Authenticate ' header .
def filter_response(req, res)
      command = nil
      if res.status == HTTP::Status::PROXY_AUTHENTICATE_REQUIRED
        if challenge = parse_authentication_header(res, 'proxy-authenticate')
          uri = req.header.request_uri
          challenge.each do |scheme, param_str|
            @authenticator.each do |auth|
              if scheme.downcase == auth.scheme.downcase
                challengeable = auth.challenge(uri, param_str)
                command = :retry if challengeable
              end
            end
          end
        end
      end
      command
    end
def filter_response ( req , res ) command = nil if res . status == HTTP :: Status :: PROXY_AUTHENTICATE_REQUIRED if challenge = parse_authentication_header ( res , 'proxy-authenticate' ) uri = req . header . request_uri challenge . each do | scheme , param_str | @authenticator . each do | auth | if scheme . downcase == auth . scheme . downcase challengeable = auth . challenge ( uri , param_str ) command = :retry if challengeable end end end end end command end
Filter API implementation.
Filter API implementation .
# ignore unknown authentication scheme
req
<not_specific>
res
<not_specific>