Method: ActionController::HttpAuthentication::Digest#decode_credentials

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

#decode_credentials(header) ⇒ Object



267
268
269
270
271
272
# File 'actionpack/lib/action_controller/metal/http_authentication.rb', line 267

def decode_credentials(header)
  ActiveSupport::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