From 9e2948e750fa3f641f20adad4b4ecae89b35faa7 Mon Sep 17 00:00:00 2001 From: grosser Date: Sat, 22 Sep 2012 19:36:45 -0700 Subject: depreacte unused Mime::Type#verify_request? and Mime::Type.browser_generated_types --- actionpack/lib/action_dispatch/http/mime_type.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb index f86ae26b8a..3d560518e1 100644 --- a/actionpack/lib/action_dispatch/http/mime_type.rb +++ b/actionpack/lib/action_dispatch/http/mime_type.rb @@ -57,7 +57,6 @@ module Mime # i.e. following a link, getting an image or posting a form. CSRF protection # only needs to protect against these types. @@browser_generated_types = Set.new [:html, :url_encoded_form, :multipart_form, :text] - cattr_reader :browser_generated_types attr_reader :symbol @register_callbacks = [] @@ -276,9 +275,15 @@ module Mime # Returns true if Action Pack should check requests using this Mime Type for possible request forgery. See # ActionController::RequestForgeryProtection. def verify_request? + ActiveSupport::Deprecation.warn "Mime::Type#verify_request? is deprecated and will be removed in Rails 4.1" @@browser_generated_types.include?(to_sym) end + def self.browser_generated_types + ActiveSupport::Deprecation.warn "Mime::Type.browser_generated_types is deprecated and will be removed in Rails 4.1" + @@browser_generated_types + end + def html? @@html_types.include?(to_sym) || @string =~ /html/ end -- cgit v1.2.3