This project is archived and is in readonly mode.

#869 ✓resolved
Sam Ruby

default_charset = nil produces bogus content-type header

Reported by Sam Ruby | August 20th, 2008 @ 02:41 PM | in 2.x

To work around bugs in IE7, it is necessary to sometimes not send a charset parameter in a content-type header. See http://golem.ph.utexas.edu/~dist... for an example.

Setting ActionController.default_charset = nil would seem to address this, but unfortunately it results in a header such as the following to be sent:

Content-Type: application/xhtml+xml; charset=

The suggested fix is to make ActionController::AbstractResponse#charset= match the behavior of content_type= and not insert the charset parameter into the content type if nil.

An alternate fix (one that would be less failsafe) would be to modify AbstractResponse#assign_default_content_type_and_charset to not set response.charset if the default is nil.

Comments and changes to this ticket

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

Pages