Method: ActionController::HttpAuthentication::Digest#decode_credentials

Defined in:
lib/action_controller/metal/http_authentication.rb

#decode_credentials(header) ⇒ Object



229
230
231
232
233
234
# File 'lib/action_controller/metal/http_authentication.rb', line 229

def decode_credentials(header)
  HashWithIndifferentAccess[header.to_s.gsub(/^Digest\s+/,'').split(',').map do |pair|
    key, value = pair.split('=', 2)
    [key.strip, value.to_s.gsub(/^"|"$/,'').delete('\'')]
  end]
end