@content_security_policy %ContentSecurityPolicy.Policy{
default_src: [
"'unsafe-inline'",
"'unsafe-eval'",
"'self'",
"https://cdnjs.cloudflare.com",
"https://cdn.skypack.dev",
"https://res.cloudinary.com"
]
}
pipeline :browser do
...
plug(:put_secure_browser_headers, %{"content-security-policy" => ContentSecurityPolicy.serialize(@content_security_policy)})
...
end
Using the
plug ContentSecurityPolicy.Plug.Setupwas causing Sobelow to still complain.So I did this to fix it:
Not sure if there is a better way?