aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-10-28 00:12:35 -0700
committerYehuda Katz <wycats@gmail.com>2009-10-28 00:12:35 -0700
commit0b2dd7afd9ee1dfe46506f9d745afb0a23e496ba (patch)
tree7859f3e112a7f1ed97600469853370ac47ddefea /actionpack/lib/action_dispatch/http
parentcbcb947b00a7c6992cfe42c6b369e87b4fa4ee23 (diff)
downloadrails-0b2dd7afd9ee1dfe46506f9d745afb0a23e496ba.tar.gz
rails-0b2dd7afd9ee1dfe46506f9d745afb0a23e496ba.tar.bz2
rails-0b2dd7afd9ee1dfe46506f9d745afb0a23e496ba.zip
Reorganize CSRF a bit
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rwxr-xr-xactionpack/lib/action_dispatch/http/request.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index 1e366520c9..bb99fac5e0 100755
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -97,6 +97,10 @@ module ActionDispatch
end
end
+ def forgery_whitelisted?
+ method == :get || xhr? || !(!content_type.nil? && content_type.verify_request?)
+ end
+
def media_type
content_type.to_s
end