X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fplugs%2Fhttp_security_plug.ex;h=6841b13aa35caeee7bbff998bd27832ba1836a20;hb=8a4437d2bee6ae5f07935a8a6471e8c8dac7f3b1;hp=5f0b775bea9e1025b28bdbc03111308743f7c02a;hpb=9a320ba8149a3efae1235b3b68dbf1bbad423e0d;p=akkoma diff --git a/lib/pleroma/web/plugs/http_security_plug.ex b/lib/pleroma/web/plugs/http_security_plug.ex index 5f0b775be..6841b13aa 100644 --- a/lib/pleroma/web/plugs/http_security_plug.ex +++ b/lib/pleroma/web/plugs/http_security_plug.ex @@ -106,20 +106,17 @@ defmodule Pleroma.Web.Plugs.HTTPSecurityPlug do connect_src = if Config.get([:media_proxy, :enabled]) do sources = build_csp_multimedia_source_list() - ["connect-src 'self' blob: ", static_url, ?\s, websocket_url, ?\s, sources] + ["connect-src 'self' ", static_url, ?\s, websocket_url, ?\s, sources] else - ["connect-src 'self' blob: ", static_url, ?\s, websocket_url] + ["connect-src 'self' ", static_url, ?\s, websocket_url] end - style_src = "style-src 'self' 'unsafe-inline'" - font_src = "font-src 'self' data:" + style_src = "style-src 'self' '#{nonce_tag}'" + font_src = "font-src 'self'" - script_src = - if Config.get(:env) == :dev do - "script-src 'self' 'unsafe-eval' '#{nonce_tag}'" - else - "script-src 'self' '#{nonce_tag}'" - end + script_src = "script-src 'self' '#{nonce_tag}'" + + script_src = if Mix.env() == :dev, do: [script_src, " 'unsafe-eval'"], else: script_src report = if report_uri, do: ["report-uri ", report_uri, ";report-to csp-endpoint"] insecure = if scheme == "https", do: "upgrade-insecure-requests"