Merge pull request #25 from twitter/gh3

Honor settings in application_controller when configure block isn't used...
This commit is contained in:
Neil Matatall 2013-02-12 18:10:01 -08:00
Родитель 706db74ff2 60bd708089
Коммит 77c2748df4
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