You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2021/09/27 17:26:10 UTC

[couchdb] 01/02: Remove redundant CSP tests

This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a commit to branch remove-redundant-csp-tests
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 593539edc90e083abf8c8c1bca949ede6ed1b2fa
Author: Jay Doane <ja...@apache.org>
AuthorDate: Mon Sep 27 10:14:53 2021 -0700

    Remove redundant CSP tests
    
    These two tests exercise the same assertions as the individual
    `sandbox_doc_attachments` test case in chttpd_csp_tests.erl.
---
 src/chttpd/test/eunit/chttpd_db_test.erl | 45 --------------------------------
 1 file changed, 45 deletions(-)

diff --git a/src/chttpd/test/eunit/chttpd_db_test.erl b/src/chttpd/test/eunit/chttpd_db_test.erl
index 06ac147..d844aa5 100644
--- a/src/chttpd/test/eunit/chttpd_db_test.erl
+++ b/src/chttpd/test/eunit/chttpd_db_test.erl
@@ -69,8 +69,6 @@ all_test_() ->
                     fun should_return_404_for_delete_att_on_notadoc/1,
                     fun should_return_409_for_del_att_without_rev/1,
                     fun should_return_200_for_del_att_with_rev/1,
-                    fun should_send_csp_header_with_att/1,
-                    fun should_send_not_csp_header_with_att_when_no_config/1,
                     fun should_return_409_for_put_att_nonexistent_rev/1,
                     fun should_return_update_seq_when_set_on_all_docs/1,
                     fun should_not_return_update_seq_when_unset_on_all_docs/1,
@@ -211,49 +209,6 @@ should_return_200_for_del_att_with_rev(Url) ->
     end)}.
 
 
-should_send_csp_header_with_att(Url) ->
-  {timeout, ?TIMEOUT, ?_test(begin
-      {ok, RC, _, _} = test_request:put(
-          Url ++ "/testdoc5",
-          [?CONTENT_JSON, ?AUTH],
-          jiffy:encode(attachment_doc())
-      ),
-      ?assertEqual(201, RC),
-
-      {ok, _, Headers, _} = test_request:get(
-          Url ++ "/testdoc5/file.erl",
-          [?AUTH],
-          []
-      ),
-      CSPHeader = couch_util:get_value("Content-Security-Policy", Headers),
-      ?assertEqual("sandbox", CSPHeader)
-    end)}.
-
-
-should_send_not_csp_header_with_att_when_no_config(Url) ->
-  {timeout, ?TIMEOUT, ?_test(begin
-      {ok, RC, _, _} = test_request:put(
-          Url ++ "/testdoc6",
-          [?CONTENT_JSON, ?AUTH],
-          jiffy:encode(attachment_doc())
-      ),
-      ?assertEqual(201, RC),
-
-      config:set_boolean("csp", "attachments_enable", false, _Persist=false),
-
-      {ok, _, Headers, _} = test_request:get(
-          Url ++ "/testdoc6/file.erl",
-          [?AUTH],
-          []
-      ),
-      CSPHeader = couch_util:get_value("Content-Security-Policy", Headers),
-      ?assertEqual(undefined, CSPHeader),
-
-      config:delete("csp", "attachments_enable", _Persist=false)
-
-    end)}.
-
-
 should_return_409_for_put_att_nonexistent_rev(Url) ->
     {timeout, ?TIMEOUT, ?_test(begin
         {ok, RC, _Headers, RespBody} = test_request:put(