Module: Net::HTTPHeader

Included in:
HTTParty::Response::Headers
Defined in:
lib/httparty/net_digest_auth.rb

Defined Under Namespace

Classes: DigestAuthenticator

Instance Method Summary collapse

Instance Method Details

#digest_auth(username, password, response) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/httparty/net_digest_auth.rb', line 8

def digest_auth(username, password, response)
  authenticator = DigestAuthenticator.new(
    username,
    password,
    @method,
    @path,
    response
  )

  authenticator.authorization_header.each do |v|
    add_field('Authorization', v)
  end

  authenticator.cookie_header.each do |v|
    add_field('Cookie', v)
  end
end