This project is archived and is in readonly mode.
Bundled Rack tries to call 'split' on a Fixnum
Reported by Cody Caughlan | June 11th, 2009 @ 10:48 PM | in 2.x
In an action set a response HTTP header with a non-string value (in my case a Fixnum) but really any type that doesnt respond to 'split':
response.headers['Expires'] = 0
Throws this stack:
Thu Jun 11 14:33:56 -0700 2009: Read error: #<NoMethodError:
private method split' called for 0:Fixnum><br/>
/usr/local/ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb:66:in
process'
/usr/local/ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb:65:in
each'
/usr/local/ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb:65:in
process'
A user code fix is to just use a string value:
response.headers['Expires'] = '0'
But we can probably assume other users would be silly like me. Attached is a small patch.
Comments and changes to this ticket
-
David Trasbo April 15th, 2010 @ 09:14 PM
- Assigned user set to Ryan Bigg
Unrelated to Rails. Besides, patching vendored libraries is not a good idea. Can be marked as invalid.
-
Ryan Bigg April 15th, 2010 @ 10:44 PM
- State changed from new to wontfix
Not a rails bug. Submit a patch to Rack if you want to see this fixed.
-
Lawrence Pit August 20th, 2010 @ 07:58 AM
- Importance changed from to
Rack's specification states: "The values of the header must be Strings" -- http://rack.rubyforge.org/doc/files/SPEC.html
Rack is not going to change its spec.
So this is not about patching Rack, because it does exactly what it says.
You could question whether Rails should dump their users to the level of Rack to find out about this little quirky requirement. It's like redirecting to you to the requirements of C pointers if something doesn't quite work out in ruby.
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>