1 if defined?(CSP_REPORT_URL)
3 :preserve_schemes => true,
4 :default_src => %w['self'],
5 :child_src => %w['self'],
6 :connect_src => %w['self'],
7 :font_src => %w['none'],
8 :form_action => %w['self'],
9 :frame_ancestors => %w['self'],
10 :frame_src => %w['self'],
11 :img_src => %w['self' data: www.gravatar.com *.wp.com *.tile.openstreetmap.org *.tile.thunderforest.com *.openstreetmap.fr],
12 :manifest_src => %w['none'],
13 :media_src => %w['none'],
14 :object_src => %w['self'],
15 :plugin_types => %w[],
16 :script_src => %w['self'],
17 :style_src => %w['self'],
18 :worker_src => %w['none'],
19 :report_uri => [CSP_REPORT_URL]
22 csp_policy[:connect_src] << PIWIK["location"] if defined?(PIWIK)
23 csp_policy[:img_src] << PIWIK["location"] if defined?(PIWIK)
24 csp_policy[:script_src] << PIWIK["location"] if defined?(PIWIK)
26 csp_policy = SecureHeaders::OPT_OUT
30 :secure => SecureHeaders::OPT_OUT,
31 :httponly => SecureHeaders::OPT_OUT
34 SecureHeaders::Configuration.default do |config|
35 config.hsts = SecureHeaders::OPT_OUT
36 config.csp = SecureHeaders::OPT_OUT
37 config.csp_report_only = csp_policy
38 config.cookies = cookie_policy