diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-10-28 00:12:35 -0700 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-10-28 00:12:35 -0700 |
commit | 0b2dd7afd9ee1dfe46506f9d745afb0a23e496ba (patch) | |
tree | 7859f3e112a7f1ed97600469853370ac47ddefea /actionpack/lib/action_dispatch | |
parent | cbcb947b00a7c6992cfe42c6b369e87b4fa4ee23 (diff) | |
download | rails-0b2dd7afd9ee1dfe46506f9d745afb0a23e496ba.tar.gz rails-0b2dd7afd9ee1dfe46506f9d745afb0a23e496ba.tar.bz2 rails-0b2dd7afd9ee1dfe46506f9d745afb0a23e496ba.zip |
Reorganize CSRF a bit
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rwxr-xr-x | actionpack/lib/action_dispatch/http/request.rb | 4 |
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 |