diff options
author | Jay Doane <jaydoane@apache.org> | 2021-09-27 10:14:53 -0700 |
---|---|---|
committer | Jay Doane <jay.s.doane@gmail.com> | 2021-09-27 11:11:44 -0700 |
commit | c2f231ca2e5f789974800d972bbbb65db06a3256 (patch) | |
tree | 58284e3df84d26bf0a1c09a7b24e75b43ebee15d | |
parent | 4f33f14deb733f36cf0df03aedceebc746716d8c (diff) | |
download | couchdb-c2f231ca2e5f789974800d972bbbb65db06a3256.tar.gz |
Remove redundant CSP tests
These two tests exercise the same assertions as the individual
`sandbox_doc_attachments` test case in chttpd_csp_tests.erl.
-rw-r--r-- | src/chttpd/test/eunit/chttpd_db_test.erl | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/chttpd/test/eunit/chttpd_db_test.erl b/src/chttpd/test/eunit/chttpd_db_test.erl index 06ac147e6..d844aa5b6 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( |