This project is archived and is in readonly mode.

#4727 ✓resolved

Use Rack::Utils.bytesize instead of #length when determining request content-length for showing exceptions.

Reported by tarsolya | May 29th, 2010 @ 09:07 PM | in 3.0.2

Showing the Exception Caught page raises a Rack::Lint::LintError when UTF-8 characters are present in the returned exception template under Ruby 1.9.

This is happening when the 'Extrcated Source' block in the template cites a section from a file which is UTF-8 and the section cited contains multibyte characters (like 'áéíőű', for example). Showing exceptions' render method in the ActionPack middleware still uses Sring.length to calculate content-length. This is bad under Ruby 1.9, because it doesn't produce the proper byte size results with multibyte characters.

Instead of this, we can use Rack::Utils.bytesize to properly calculate content-length either under the Ruby 1.8 or the Ruby 1.9 branch.

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=""></a>

Referenced by