From 60bd70808920eaebba469e4703c2f816f5d8d2b9 Mon Sep 17 00:00:00 2001 From: Neil Matatall Date: Tue, 12 Feb 2013 16:21:24 -0800 Subject: [PATCH] Honor settings in application_controller when configure block isn't used #3 --- lib/secure_headers.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/secure_headers.rb b/lib/secure_headers.rb index 4e10ea1..9570810 100644 --- a/lib/secure_headers.rb +++ b/lib/secure_headers.rb @@ -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