GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: Merb Core: All you need. None you don't.
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb-core.git
check for empty string before calling to_sym on the format parameter

Altered ResponderMixin#_perform_content_negotiation to check if the format

is an empty string before calling to_sym on it.  This bug appears after 
using
the url helper from patch #33 of merb-more.

Signed-off-by: Michael D. Ivey <ivey@gweezlebur.com>
benburkert (author)
Thu Feb 14 21:45:30 -0800 2008
ivey (committer)
Fri Feb 15 17:45:57 -0800 2008
commit  1d217467976ed560c03a1709f297ab341d9ed419
tree    e70535501427cec4f7b691fd97095073bd359f3a
parent  ba0c52d107d3404f2a4172a37f5be24096de995d
...
282
283
284
285
 
286
287
288
...
282
283
284
 
285
286
287
288
0
@@ -282,7 +282,7 @@ module Merb
0
     # 5. Raise 406 if none found
0
     def _perform_content_negotiation # :nodoc:
0
       raise Merb::ControllerExceptions::NotAcceptable if _provided_formats.empty?
0
- if (fmt = params[:format]) && _provided_formats.include?(fmt.to_sym)
0
+ if (fmt = params[:format]) && !fmt.empty? && _provided_formats.include?(fmt.to_sym)
0
         return fmt.to_sym
0
       end
0
       accepts = Responder.parse(request.accept).map {|t| t.to_sym}

Comments

    No one has commented yet.