Forum: Ruby on Rails strange output in http header

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Sam J. (Guest)
on 2005-12-29 17:39
(Received via mailing list)
Hi there,

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
Cache-Control: no-cache
Set-Cookie: _session_id=fdbd2acf8c42295dc24b163a9fe9db95; path=/
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/plain

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:

def tree
items_per_page = 5
if !params[:items_per_page].nil?
items_per_page = params[:items_per_page].to_i
@conditions = "parent_id IS NULL" params[:id]
unless params[:id].nil? "creating discussion"
@conditions += " AND creation_disc_id = "+params[:id]
@discussion = Discussion.find(params[:id])
@message_pages = self, Message.count( @conditions ),
items_per_page, @params['page']
@messages = Message.find(:all, :conditions => @conditions, :order =>
'creation_date DESC',
: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
like this.

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.

Many thanks.

This topic is locked and can not be replied to.