diff options
author | eugenijm <eugenijm@protonmail.com> | 2021-01-08 12:06:04 +0300 |
---|---|---|
committer | eugenijm <eugenijm@protonmail.com> | 2021-01-21 21:55:11 +0300 |
commit | 133644dfa2e46dc48980ae6f835b7aa2758b4250 (patch) | |
tree | ab043113d6db4cc4729aad8cbded8a8bd8ff185e /test | |
parent | d8860eaee46c9bc0a079e90dfb008c54923d7330 (diff) | |
download | pleroma-133644dfa2e46dc48980ae6f835b7aa2758b4250.tar.gz |
Ability to set the Service-Worker-Allowed header
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/plugs/http_security_plug_test.exs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/pleroma/web/plugs/http_security_plug_test.exs b/test/pleroma/web/plugs/http_security_plug_test.exs index 4233e85c0..26c9fd317 100644 --- a/test/pleroma/web/plugs/http_security_plug_test.exs +++ b/test/pleroma/web/plugs/http_security_plug_test.exs @@ -72,6 +72,14 @@ defmodule Pleroma.Web.Plugs.HTTPSecurityPlugTest do assert csp =~ "media-src 'self' https:;" assert csp =~ "img-src 'self' data: blob: https:;" end + + test "it sets the Service-Worker-Allowed header", %{conn: conn} do + clear_config([:http_security, :enabled], true) + clear_config([:http_security, :service_worker_allowed], "/") + + conn = get(conn, "/api/v1/instance") + assert Conn.get_resp_header(conn, "service-worker-allowed") == ["/"] + end end describe "img-src and media-src" do |