SecureHeaders::ClassMethods

Attributes

secure_headers_options[W]

Public Instance Methods

ensure_security_headers(options = {}) click to toggle source
# File lib/secure_headers.rb, line 34
def ensure_security_headers options = {}
  self.secure_headers_options = options
  before_filter :set_hsts_header
  before_filter :set_x_frame_options_header
  before_filter :set_csp_header
  before_filter :set_x_xss_protection_header
  before_filter :set_x_content_type_options_header
end
options_for(type, options) click to toggle source

we can't use ||= because I'm overloading false => disable, nil => default both of which trigger the conditional assignment

# File lib/secure_headers.rb, line 45
def options_for(type, options)
  options.nil? ? ::SecureHeaders::Configuration.send(type) : options
end
secure_headers_options() click to toggle source
# File lib/secure_headers.rb, line 24
def secure_headers_options
  if @secure_headers_options
    @secure_headers_options
  elsif superclass.respond_to?(:secure_headers_options) # stop at application_controller
    superclass.secure_headers_options
  else
    {}
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.