module Net::HTTPHeader

Public Instance Methods

append_cookies(authenticator) click to toggle source
# File lib/httparty/net_digest_auth.rb, line 19
def append_cookies(authenticator)
  cookies = @header['cookie'] ? @header['cookie'] : []
  cookies.concat(authenticator.cookie_header)
end
digest_auth(username, password, response) click to toggle source
# File lib/httparty/net_digest_auth.rb, line 6
def digest_auth(username, password, response)
  authenticator = DigestAuthenticator.new(
    username,
    password,
    @method,
    @path,
    response
  )

  @header['Authorization'] = authenticator.authorization_header
  @header['cookie'] = append_cookies(authenticator) if response['Set-Cookie']
end