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 2012/12/04 21:33:02 UTC
[3/3] git commit: test for case-sensitive mismatch of config
test for case-sensitive mismatch of config
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/b48284c1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/b48284c1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/b48284c1
Branch: refs/heads/431-feature-cors
Commit: b48284c140b3cd94ebe80eaa69b23f2e59047983
Parents: ea7186d
Author: Jan Lehnardt <ja...@apache.org>
Authored: Tue Dec 4 21:01:40 2012 +0100
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Tue Dec 4 21:01:40 2012 +0100
----------------------------------------------------------------------
test/etap/231-cors.t | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/b48284c1/test/etap/231-cors.t
----------------------------------------------------------------------
diff --git a/test/etap/231-cors.t b/test/etap/231-cors.t
index 6b0f86f..9dc9fff 100644
--- a/test/etap/231-cors.t
+++ b/test/etap/231-cors.t
@@ -32,7 +32,7 @@ server() ->
main(_) ->
test_util:init_code_path(),
- etap:plan(16),
+ etap:plan(17),
case (catch test()) of
ok ->
etap:end_tests();
@@ -108,6 +108,7 @@ test() ->
% TBD
% case-sensitive mismatch of allowed origins should fail
+ test_case_sensitive_mismatch_of_allowed_origins(),
% auth with * Origin should fail
% test all cors with vhosts
% test multiple per-host configuration
@@ -318,3 +319,15 @@ test_preflight_with_scheme2() ->
_ ->
etap:is(false, true, "ibrowse failed")
end.
+
+test_case_sensitive_mismatch_of_allowed_origins() ->
+ Headers = [{"Origin", "http://EXAMPLE.COM"}],
+ Url = server() ++ "etap-test-db",
+ case ibrowse:send_req(Url, Headers, get, []) of
+ {ok, _, RespHeaders, _Body} ->
+ etap:is(proplists:get_value("Access-Control-Allow-Origin", RespHeaders),
+ undefined,
+ "db access config case mismatch");
+ _ ->
+ etap:is(false, true, "ibrowse failed")
+ end.
\ No newline at end of file