HTTP 200 - Internal server error #605

axos88 opened this Issue Sep 23, 2013 · 2 comments


None yet
3 participants

axos88 commented Sep 23, 2013


If I return

[200, { 'Content-Type' => 'text/html' }, 'OK']

instead of

[200, { 'Content-Type' => 'text/html' }, ['OK']]

I get a HTTP 200 response, with the body string "HTTP/1.1 Internal Server Error".

Expected behaviour: get a HTTP 5xx response.


rkh commented Sep 23, 2013

This is inherent to the rack handler sending out the status code before iterating over the body. The rack handler could check if the body actually responds to each before sending out the status code, but I don't know about any that does this. Rack::Lint should catch this in development mode, as it is a protocol violation. Which rack handler are you using?


raggi commented Dec 28, 2013

I think this is a server bug.

Please provide a replication case with specific server details. Against Webrick, this bug does not appear:

curl -D- -O /dev/null http://localhost:9292/ HTTP/1.1 500 Internal Server Error Content-Type: text/html; charset=ISO-8859-1 Transfer-Encoding: chunked Server: WEBrick/1.3.1 (Ruby/2.0.0/2013-11-22) Date: Sat, 28 Dec 2013 17:44:07 GMT Content-Length: 314 Connection: close

raggi closed this Dec 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment