Module: SecureHeaders::ControllerExtension::ClassMethods
- Defined in:
- lib/secure_headers/controller_extension.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#secure_headers_options ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/secure_headers/controller_extension.rb', line 14 def if elsif superclass.respond_to?(:secure_headers_options) # stop at application_controller superclass. else {} end end |
Instance Method Details
#ensure_security_headers(options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/secure_headers/controller_extension.rb', line 24 def ensure_security_headers = {} if RUBY_VERSION == "1.8.7" warn "[DEPRECATION] secure_headers ruby 1.8.7 support will dropped in the next release" end self. = hook = respond_to?(:before_action) ? :before_action : :before_filter ::SecureHeaders::ALL_FILTER_METHODS.each do |method| send(hook, method) end end |