Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reverts rendering behavior when format is unknown

If a request has unknown format (eg. /foo.bar), the renderer
fallbacks to default format.

This patch reverts Rails 3.2 behavior after c2267db commit.

Fixes issue #9654.
  • Loading branch information...
commit d50df2f116bfb1f3e897746fb345a5e945650e31 1 parent 17a886b
@gswirski gswirski authored pixeltrix committed
View
2  actionpack/lib/action_controller/metal/rendering.rb
@@ -6,7 +6,7 @@ module Rendering
# Before processing, set the request formats in current controller formats.
def process_action(*) #:nodoc:
- self.formats = request.formats.map { |x| x.ref }
+ self.formats = request.formats.select { |x| !x.nil? }.map(&:ref)
super
end
View
6 actionpack/lib/action_dispatch/http/mime_type.rb
@@ -306,12 +306,16 @@ def respond_to_missing?(method, include_private = false) #:nodoc:
method.to_s.ends_with? '?'
end
end
-
+
class NullType
def nil?
true
end
+ def respond_to_missing?(method, include_private = false)
+ method.to_s.ends_with? '?'
+ end
+
private
def method_missing(method, *args)
false if method.to_s.ends_with? '?'
Please sign in to comment.
Something went wrong with that request. Please try again.