Question

I'm trying to deploy a Rails 3.2 app on JBOSS AS 7.1, using JRuby 1.6.6.

When the Rails controller sets a status code for the HTTP response header to anything other than 200, all the text from the response body is stripped -- apparently by JBoss. The problem does not occur under WebBrick.

Here is a little code to illustrate:

def show
  # The text below is never displayed when app deployed under JBoss
  render :text => "Hello user, send a better id next time", :status => :not_found
end

Any idea why JBoss might be eating the message body for the response?

If it's trying to optimize, that seems in violation of (at least the spirit) of the HTTP spec, which says 404 packets may contain message bodies.

Setting the status correctly is useful for automating testing among other things.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top