aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base/request_forgery_protection.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-17 16:14:05 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-17 16:14:05 -0700
commit8fdf3d7890d2e58508e028c93d3797f21a774dbc (patch)
tree4eff185e19bd63161ad15fb47120f53e93debcf5 /actionpack/lib/action_controller/base/request_forgery_protection.rb
parent251a6e492c72d8aea713b7dabd245d68301e455d (diff)
downloadrails-8fdf3d7890d2e58508e028c93d3797f21a774dbc.tar.gz
rails-8fdf3d7890d2e58508e028c93d3797f21a774dbc.tar.bz2
rails-8fdf3d7890d2e58508e028c93d3797f21a774dbc.zip
Remove some defined?(Http) checks
Diffstat (limited to 'actionpack/lib/action_controller/base/request_forgery_protection.rb')
-rw-r--r--actionpack/lib/action_controller/base/request_forgery_protection.rb18
1 files changed, 7 insertions, 11 deletions
diff --git a/actionpack/lib/action_controller/base/request_forgery_protection.rb b/actionpack/lib/action_controller/base/request_forgery_protection.rb
index a470c8eec1..6ba86cd0be 100644
--- a/actionpack/lib/action_controller/base/request_forgery_protection.rb
+++ b/actionpack/lib/action_controller/base/request_forgery_protection.rb
@@ -6,20 +6,16 @@ module ActionController #:nodoc:
extend ActiveSupport::Concern
# TODO : Remove the defined? check when new base is the main base
- if defined?(ActionController::Http)
- include AbstractController::Helpers, Session
- end
+ include AbstractController::Helpers, Session
included do
- if defined?(ActionController::Http)
- # Sets the token parameter name for RequestForgery. Calling +protect_from_forgery+
- # sets it to <tt>:authenticity_token</tt> by default.
- cattr_accessor :request_forgery_protection_token
+ # Sets the token parameter name for RequestForgery. Calling +protect_from_forgery+
+ # sets it to <tt>:authenticity_token</tt> by default.
+ cattr_accessor :request_forgery_protection_token
- # Controls whether request forgergy protection is turned on or not. Turned off by default only in test mode.
- class_inheritable_accessor :allow_forgery_protection
- self.allow_forgery_protection = true
- end
+ # Controls whether request forgergy protection is turned on or not. Turned off by default only in test mode.
+ class_inheritable_accessor :allow_forgery_protection
+ self.allow_forgery_protection = true
helper_method :form_authenticity_token
helper_method :protect_against_forgery?