aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/request.rb
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-03-28 13:40:38 -0700
committerwycats <wycats@gmail.com>2010-03-28 13:40:38 -0700
commit77a2a3d9b3aa461437ced326ea4a70112a8c68ed (patch)
treeeb236e6832815f95629d4b00a475e19dc2e575aa /actionpack/lib/action_dispatch/http/request.rb
parente1a70faea675499d717cef7662262ceb03b23975 (diff)
downloadrails-77a2a3d9b3aa461437ced326ea4a70112a8c68ed.tar.gz
rails-77a2a3d9b3aa461437ced326ea4a70112a8c68ed.tar.bz2
rails-77a2a3d9b3aa461437ced326ea4a70112a8c68ed.zip
Request#content_type exists in Rack::Request, and other parts of Rack::Request expect
it to return a String. Split the Rails API so that Request#content_type returns a String, and Request#content_mime_type returns a Mime::Type object.
Diffstat (limited to 'actionpack/lib/action_dispatch/http/request.rb')
-rwxr-xr-xactionpack/lib/action_dispatch/http/request.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index ea9f0f99c2..8b8426b5aa 100755
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -96,11 +96,11 @@ module ActionDispatch
end
def forgery_whitelisted?
- method == :get || xhr? || content_type.nil? || !content_type.verify_request?
+ method == :get || xhr? || content_mime_type.nil? || !content_mime_type.verify_request?
end
def media_type
- content_type.to_s
+ content_mime_type.to_s
end
# Returns the content length of the request as an integer.
@@ -157,7 +157,7 @@ module ActionDispatch
end
def form_data?
- FORM_DATA_MEDIA_TYPES.include?(content_type.to_s)
+ FORM_DATA_MEDIA_TYPES.include?(content_mime_type.to_s)
end
def body_stream #:nodoc: