    # File lib/action_controller/http_authentication.rb, line 189
          def validate_digest_response(request, realm, &password_procedure)
            credentials = decode_credentials_header(request)
            valid_nonce = validate_nonce(request, credentials[:nonce])

            if valid_nonce && realm == credentials[:realm] && opaque == credentials[:opaque]
              password = password_procedure.call(credentials[:username])
              return false unless password

              method = request.env['rack.methodoverride.original_method'] || request.env['REQUEST_METHOD']
              uri    = credentials[:uri][0,1] == '/' ? request.request_uri : request.url

             [true, false].any? do |password_is_ha1|
               expected = expected_response(method, uri, credentials, password, password_is_ha1)
               expected == credentials[:response]
             end
            end
          end