Module: SecureHeaders::ClassMethods

Defined in:
lib/secure_headers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#secure_headers_optionsObject



85
86
87
88
89
90
91
92
93
# File 'lib/secure_headers.rb', line 85

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

Instance Method Details

#ensure_security_headers(options = {}) ⇒ Object



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/secure_headers.rb', line 95

def ensure_security_headers options = {}
  if RUBY_VERSION == "1.8.7"
    warn "[DEPRECATION] secure_headers ruby 1.8.7 support will dropped in the next release"
  end
  self.secure_headers_options = options
  before_filter :prep_script_hash
  before_filter :set_hsts_header
  before_filter :set_hpkp_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
  before_filter :set_x_download_options_header
  before_filter :set_x_permitted_cross_domain_policies_header
end