This project is archived and is in readonly mode.

#1602 ✓wontfix
ronin-24025 (at lighthouseapp)

failsafe_response 200 OK

Reported by ronin-24025 (at lighthouseapp) | December 19th, 2008 @ 07:18 AM | in 2.x

I've been invoking internal server errors to test Rails status code handling by sending in some malformed JSON.

For an internal server error, however, failsafe_response returns Status: 200 OK with the following in the response body:


Status: 500 Internal Server Error

Content-Type: text/html

<html><body><h1>500 Internal Server Error</h1></body></html>

As an aside, I think Rail's error handling schizophrenia between production and development needs to be simplified. Just send the right status header and put just the status text in the response body (to help clients who can't get at the Status header). The developer can get his exception report in the server logs.

Comments and changes to this ticket

  • josh

    josh December 20th, 2008 @ 04:36 PM

    • State changed from “new” to “wontfix”
    
          def failsafe_response(exception)
            log_failsafe_exception(exception)
            [500, {'Content-Type' => 'text/html'}, failsafe_response_body]
          rescue Exception => failsafe_error # Logger or IO errors
            $stderr.puts "Error during failsafe response: #{failsafe_error}"
          end
    

    Looks like a 500 status code to me. Are you on edge?

  • Bill Kirtley

    Bill Kirtley March 3rd, 2009 @ 08:36 PM

    This bug exists in versions of Rails up to 2.2.2, but not in the 2.3 code.

    Will there be a 2.2.3? Is there somewhere to submit a patch?

    http://billkirtley.wordpress.com...

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages