Commit c71b3a1b authored by Haelwenn's avatar Haelwenn

Merge branch 'fix-csp-upgrade-insecure-requests-check' into 'develop'

Fix CSP check for 'upgrade-insecure-requests'

See merge request !814
parents e1983fca ea105892
Pipeline #7470 failed with stages
in 2 minutes and 2 seconds
......@@ -33,7 +33,7 @@ defmodule Pleroma.Plugs.HTTPSecurityPlug do
end
defp csp_string do
protocol = Config.get([Pleroma.Web.Endpoint, :protocol])
scheme = Config.get([Pleroma.Web.Endpoint, :url])[:scheme]
[
"default-src 'none'",
......@@ -46,7 +46,7 @@ defmodule Pleroma.Plugs.HTTPSecurityPlug do
"script-src 'self'",
"connect-src 'self' " <> String.replace(Pleroma.Web.Endpoint.static_url(), "http", "ws"),
"manifest-src 'self'",
if protocol == "https" do
if scheme == "https" do
"upgrade-insecure-requests"
end
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment