mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-03-06 19:11:27 +01:00
Move default_style_src
into the vite_hmr?
block too
This commit is contained in:
parent
e795dfc7cd
commit
6468bdacdf
1 changed files with 2 additions and 2 deletions
|
@ -72,13 +72,13 @@ defmodule PhilomenaWeb.ContentSecurityPolicyPlug do
|
||||||
vite_hmr? do
|
vite_hmr? do
|
||||||
defp default_script_src(host), do: "'self' #{host}:5173"
|
defp default_script_src(host), do: "'self' #{host}:5173"
|
||||||
defp default_connect_src(host), do: "'self' #{host}:5173 ws://#{host}:5173"
|
defp default_connect_src(host), do: "'self' #{host}:5173 ws://#{host}:5173"
|
||||||
|
defp default_style_src, do: "'self' 'unsafe-inline'"
|
||||||
else
|
else
|
||||||
defp default_connect_src(_host), do: "'self'"
|
defp default_connect_src(_host), do: "'self'"
|
||||||
defp default_script_src(_host), do: "'self'"
|
defp default_script_src(_host), do: "'self'"
|
||||||
|
defp default_style_src, do: "'self'"
|
||||||
end
|
end
|
||||||
|
|
||||||
defp default_style_src, do: vite_hmr?(do: "'self' 'unsafe-inline'", else: "'self'")
|
|
||||||
|
|
||||||
defp to_uri(host) when host in [nil, ""], do: ""
|
defp to_uri(host) when host in [nil, ""], do: ""
|
||||||
defp to_uri(host), do: URI.to_string(%URI{scheme: "https", host: host})
|
defp to_uri(host), do: URI.to_string(%URI{scheme: "https", host: host})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue