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.

Bundled Rack tries to call 'split' on a Fixnum

#2793

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:inprocess' /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:inprocess'

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.

Reported by Cody Caughlan · June 11th, 2009 @ 10:48 PM

State: wontfix
Milestone: 2.x
Assigned to: Ryan Bigg Ryan Bigg
Importance: none

Activity

  1. David Trasbo
    David Trasbo
    • Assigned user set to Ryan Bigg

    Unrelated to Rails. Besides, patching vendored libraries is not a good idea. Can be marked as invalid.

    April 15th, 2010 @ 09:14 PM

  2. Ryan Bigg
    Ryan Bigg
    • State changed from new to wontfix

    Not a rails bug. Submit a patch to Rack if you want to see this fixed.

    April 15th, 2010 @ 10:44 PM

  3. Lawrence Pit
    Lawrence Pit
    • 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.

    August 20th, 2010 @ 07:58 AM

  4. Ryan Bigg
    Ryan Bigg

    Automatic cleanup of spam.

    October 11th, 2010 @ 10:54 AM