Honor settings in application_controller when configure block isn't used #3

This commit is contained in:
Neil Matatall 2013-02-12 16:21:24 -08:00
Родитель 706db74ff2
Коммит 60bd708089
1 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -13,16 +13,24 @@ module SecureHeaders
class << self
def append_features(base)
base.module_eval do
@@secure_headers_options = nil
extend ClassMethods
include InstanceMethods
# jank?
def self.secure_headers_options=(opts)
@@secure_headers_options = opts
end
def self.secure_headers_options
@@secure_headers_options
end
end
end
end
module ClassMethods
attr_accessor :secure_headers_options
def ensure_security_headers options = {}, *args
self.secure_headers_options = options
before_filter :set_security_headers