Skip to content

Commit

Permalink
remove unnecessary elements from CSP
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanage999 committed Aug 8, 2020
1 parent 76dc016 commit 6024e1a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions config/initializers/content_security_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ def host_to_url(str)
p.base_uri :none
p.default_src :none
p.frame_ancestors :none
p.font_src :self, assets_host, :data
p.font_src :self, assets_host
p.img_src :self, :https, :data, :blob, assets_host
p.style_src :self, assets_host
p.media_src :self, :https, :data, assets_host
p.frame_src :self, :https
p.manifest_src :self, assets_host
p.child_src :self, :blob
p.worker_src :self, :blob
p.report_uri 'https://mastodon.crazynewworld.net/cspcheck/wtf'

if Rails.env.development?
Expand All @@ -37,13 +35,11 @@ def host_to_url(str)
p.script_src :self, :unsafe_inline, :unsafe_eval, assets_host
p.child_src :self, :blob, assets_host
p.worker_src :self, :blob, assets_host
p.child_src :self, :blob, assets_host
else
p.connect_src :self, :data, :blob, assets_host, media_host, Rails.configuration.x.streaming_api_base_url
p.script_src :self, assets_host
p.child_src :self, :blob, assets_host
p.worker_src :self, :blob, assets_host
p.child_src :self, :blob, assets_host
end
end

Expand Down

0 comments on commit 6024e1a

Please sign in to comment.