This project is archived and is in readonly mode.
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
-
tarsolya May 29th, 2010 @ 09:11 PM
- no changes were found...
-
Norman Clarke May 29th, 2010 @ 09:39 PM
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.
-
tarsolya May 29th, 2010 @ 09:47 PM
Good point. You are right. Attached the modified patchfile.
Thanks.
-
Michael Koziarski June 13th, 2010 @ 11:49 PM
- Milestone cleared.
-
Santiago Pastorino June 15th, 2010 @ 10:58 PM
- Milestone cleared.
- State changed from new to open
- Assigned user set to José Valim
-
Repository June 19th, 2010 @ 11:59 PM
- State changed from open to resolved
(from [bb6cd6d3ec02996c7dd11a4bb96381da18b7de8a]) Use Rack::Utils.bytesize when calculating content-length of exception pages. [#4727 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/bb6cd6d3ec02996c7dd11a4bb96381... -
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
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
Attachments
Tags
Referenced by
- 4727 Use Rack::Utils.bytesize instead of #length when determining request content-length for showing exceptions. (from [bb6cd6d3ec02996c7dd11a4bb96381da18b7de8a]) Use Rac...