Extract value and directives
This commit is contained in:
Родитель
7e14d57627
Коммит
33774557b5
|
@ -69,24 +69,23 @@ module SecureHeaders
|
|||
return browser_strategy.name
|
||||
end
|
||||
|
||||
# SPLIT
|
||||
def value
|
||||
return @config if @config.is_a?(String)
|
||||
if @config.nil?
|
||||
return supports_standard? ? WEBKIT_CSP_HEADER : FIREFOX_CSP_HEADER
|
||||
end
|
||||
|
||||
build_value
|
||||
if @config.nil?
|
||||
browser_strategy.csp_header
|
||||
else
|
||||
build_value
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def directives
|
||||
# can't use supports_standard because FF18 does not support this part of the standard.
|
||||
browser.firefox? ? FIREFOX_DIRECTIVES : WEBKIT_DIRECTIVES
|
||||
browser_strategy.directives
|
||||
end
|
||||
|
||||
|
||||
# KEEP
|
||||
def build_value
|
||||
fill_directives unless disable_fill_missing?
|
||||
|
|
|
@ -35,6 +35,14 @@ module SecureHeaders
|
|||
end
|
||||
base
|
||||
end
|
||||
|
||||
def csp_header
|
||||
WEBKIT_CSP_HEADER
|
||||
end
|
||||
|
||||
def directives
|
||||
WEBKIT_DIRECTIVES
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,6 +4,14 @@ module SecureHeaders
|
|||
def base_name
|
||||
FIREFOX_CSP_HEADER_NAME
|
||||
end
|
||||
|
||||
def csp_header
|
||||
FIREFOX_CSP_HEADER
|
||||
end
|
||||
|
||||
def directives
|
||||
FIREFOX_DIRECTIVES
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче