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


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

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