Skip to content

Commit

Permalink
Address content security policy warning. Needed to adjust the policy …
Browse files Browse the repository at this point in the history
…to help with SVG `data:` URLs in use by Tailwind.
  • Loading branch information
zorn committed Sep 6, 2024
1 parent cdbe53e commit 18fe752
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/flick_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ defmodule FlickWeb.Router do
plug :fetch_live_flash
plug :put_root_layout, html: {FlickWeb.Layouts, :root}
plug :protect_from_forgery
plug :put_secure_browser_headers

# Tailwind uses SVG data URLs for icons,
# so we need to allow them with `img-src`.
plug :put_secure_browser_headers, %{
"content-security-policy" => "default-src 'self'; img-src 'self' data:"
}
end

pipeline :admin do
Expand Down

0 comments on commit 18fe752

Please sign in to comment.