You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/secure_headers/configuration.rb
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ def default(&block)
28
28
#
29
29
# Returns: the newly created config
30
30
defoverride(name,base=DEFAULT_CONFIG, &block)
31
-
unlessget(base)
31
+
unlessget(base,internal: true)
32
32
raiseNotYetConfiguredError,"#{base} policy not yet supplied"
33
33
end
34
34
override=@configurations[base].dup
@@ -40,7 +40,11 @@ def override(name, base = DEFAULT_CONFIG, &block)
40
40
#
41
41
# Returns the configuration with a given name or raises a
42
42
# NotYetConfiguredError if `default` has not been called.
43
-
defget(name=DEFAULT_CONFIG)
43
+
defget(name=DEFAULT_CONFIG,internal: false)
44
+
unlessinternal
45
+
Kernel.warn"#{Kernel.caller.first}: [DEPRECATION] `#get` is deprecated. It will be removed in the next major release. Use SecureHeaders::Configuration.dup to retrieve the default config."
46
+
end
47
+
44
48
if@configurations.nil?
45
49
raiseNotYetConfiguredError,"Default policy not yet supplied"
0 commit comments