Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sobelow still reports an issue #2

Open
mplatts opened this issue Jul 27, 2022 · 1 comment
Open

Sobelow still reports an issue #2

mplatts opened this issue Jul 27, 2022 · 1 comment

Comments

@mplatts
Copy link

mplatts commented Jul 27, 2022

Using the plug ContentSecurityPolicy.Plug.Setup was causing Sobelow to still complain.

So I did this to fix it:


@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

Not sure if there is a better way?

@rellen
Copy link

rellen commented Jun 22, 2023

you could set the option to %{"content-security-policy" => ""} then put the plug after, but I'm not sure if that counts as better :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants