I’m experiencing something strange in rails http headers. The response
comes back as text/plain. The http header looks like this:
HTTP/1.1 200 OK
Date: Thu, 29 Dec 2005 15:18:18 GMT
Server: Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-16 mod_ruby/1.2.4
#<#<Class: 0x40a7f818>:0x40a7f778>Content-Type: text/html
Set-Cookie: _session_id=fdbd2acf8c42295dc24b163a9fe9db95; path=/
Keep-Alive: timeout=15, max=100
It looks like some odd kind of class is preventing the Content-Type from
being set properly - look at the 4th line.
Does anybody have any idea what might cause this? I’m using rails 0.13
and this problem occurs on both windows and debian, and only really
causes a problem in firefox.
The code that generates this is as follows:
items_per_page = 5
items_per_page = params[:items_per_page].to_i
@conditions = “parent_id IS NULL”
logger.info “creating discussion”
@conditions += " AND creation_disc_id = "+params[:id]
@discussion = Discussion.find(params[:id])
@message_pages = Paginator.new self, Message.count( @conditions ),
@messages = Message.find(:all, :conditions => @conditions, :order =>
:limit => @message_pages.items_per_page, :offset =>
if params[:context] == ‘small’
render :layout => false
and I’ve tried explicitly setting the content header (
@headers[“Content-Type”] = “text/html” ) to no avail. there are various
before_filters running but nothing I can see that would cause something
The really weird thing is that it works fine sometimes, but not others -
haven’t yet worked out any consistent pattern.
Any help greatly appreciated.