Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#4727

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.

Reported by tarsolya · May 29th, 2010 @ 09:07 PM

State: resolved
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. tarsolya
  2. Norman Clarke
    Norman Clarke

    Do we need to use Rack::Utils.bytesize? for this? Since Rails 3 now only supports 1.8.7 or higher, I think we can just use String#bytesize. I think that method is in Rack::Utils just to support 1.8.6.

    May 29th, 2010 @ 09:39 PM

  3. tarsolya
    tarsolya

    Good point. You are right. Attached the modified patchfile.

    Thanks.

    May 29th, 2010 @ 09:47 PM

  4. Norman Clarke
  5. Balint Erdi
  6. Gabor Ratky
  7. LacKac
  8. Michael Koziarski
  9. Santiago Pastorino
    Santiago Pastorino
    • Milestone cleared.
    • State changed from new to open
    • Assigned user set to José Valim

    June 15th, 2010 @ 10:58 PM

  10. Santiago Pastorino
  11. Repository
    Repository
    • State changed from open to resolved

    June 19th, 2010 @ 11:59 PM

  12. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Low

    October 15th, 2010 @ 11:01 PM