diff options
author | William Pitcock <nenolod@dereferenced.org> | 2018-11-12 15:08:02 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2018-11-12 15:08:02 +0000 |
commit | fe67665e19cc98faff4a8ee53a3f4ca4190ca2ef (patch) | |
tree | 9a6941d0e165e1f52cb414645420157ac2a0d421 /lib | |
parent | 5dda13ee5f9302cfef215c8ffaa527e9a572a37b (diff) | |
download | pleroma-fe67665e19cc98faff4a8ee53a3f4ca4190ca2ef.tar.gz |
rename CSPPlug to HTTPSecurityPlug.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/plugs/http_security_plug.ex (renamed from lib/pleroma/plugs/csp_plug.ex) | 10 | ||||
-rw-r--r-- | lib/pleroma/web/endpoint.ex | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/pleroma/plugs/csp_plug.ex b/lib/pleroma/plugs/http_security_plug.ex index 8fc21b909..8d652a2f3 100644 --- a/lib/pleroma/plugs/csp_plug.ex +++ b/lib/pleroma/plugs/http_security_plug.ex @@ -1,14 +1,14 @@ -defmodule Pleroma.Plugs.CSPPlug do +defmodule Pleroma.Plugs.HTTPSecurityPlug do alias Pleroma.Config import Plug.Conn def init(opts), do: opts def call(conn, options) do - if Config.get([:csp, :enabled]) do + if Config.get([:http_security, :enabled]) do conn = merge_resp_headers(conn, headers()) - |> maybe_send_sts_header(Config.get([:csp, :sts])) + |> maybe_send_sts_header(Config.get([:http_security, :sts])) else conn end @@ -44,8 +44,8 @@ defmodule Pleroma.Plugs.CSPPlug do end defp maybe_send_sts_header(conn, true) do - max_age_sts = Config.get([:csp, :sts_max_age]) - max_age_ct = Config.get([:csp, :ct_max_age]) + max_age_sts = Config.get([:http_security, :sts_max_age]) + max_age_ct = Config.get([:http_security, :ct_max_age]) merge_resp_headers(conn, [ {"strict-transport-security", "max-age=#{max_age_sts}; includeSubDomains"}, diff --git a/lib/pleroma/web/endpoint.ex b/lib/pleroma/web/endpoint.ex index 370d2d792..7783b8e5c 100644 --- a/lib/pleroma/web/endpoint.ex +++ b/lib/pleroma/web/endpoint.ex @@ -12,7 +12,7 @@ defmodule Pleroma.Web.Endpoint do # You should set gzip to true if you are running phoenix.digest # when deploying your static files in production. plug(CORSPlug) - plug(Pleroma.Plugs.CSPPlug) + plug(Pleroma.Plugs.HTTPSecurityPlug) plug(Plug.Static, at: "/media", from: Pleroma.Uploaders.Local.upload_path(), gzip: false) |