Sha256: 7845c3e59a18bef15487a31a4d706c255d8f4748b8cad12e442660cda2daf0f4

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

# The recommended default Content Security Policy 

BridgetownContentSecurityPolicy.configure :default do |policy|
    policy.default_src :self
    policy.img_src     :self, :data
    policy.object_src  :none
end

# All other policies with inherit from :default
# To allow inline styles on certain pages, we can define the following
# policy which inherits all the values from :default and defines a style_src
# 
# BridgetownContentSecurityPolicy.configure :allow_inline_styles do |policy|
#     policy.style_src   :self, :unsafe_inline
# end


# This is an example of a more complex policy demonstrating the DSL
# For further information see the following documentation
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy

# BridgetownContentSecurityPolicy.configure :default do |policy|
#     policy.default_src :self
#     policy.font_src    :self, :https, :data
#     policy.img_src     :self, :https, :data
#     policy.object_src  :none
#     policy.script_src  :self, :https
#     policy.style_src   :self, :https
# end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bridgetown-content-security-policy-0.1.0 templates/content_security_policy.config.rb