anchor.diff:  -include_lib("couch/include/couch_eunit.hrl").
   -include_lib("couch/include/couch_db.hrl").
   
  -
  --define(SUPPORTED_METHODS,
  -        "GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT, COPY, OPTIONS").
  +-include_lib("chttpd/include/chttpd_cors.hrl").
  +
   -define(TIMEOUT, 1000).
   
  +-define(_assertEqualLists(A, B),
  +    ?_assertEqual(lists:usort(A), lists:usort(B))).
  +
  +-define(assertEqualLists(A, B),
  +    ?assertEqual(lists:usort(A), lists:usort(B))).
   
   start() ->
       Ctx = test_util:start_couch([ioq]),
  
positive.code:         ?assertEqual(
              "http://example.com",
              proplists:get_value("Access-Control-Allow-Origin", Resp)),
          ?assertEqual(
              "Cache-Control, Content-Type, Server",
              proplists:get_value("Access-Control-Expose-Headers", Resp))
      end).
  
  should_make_preflight_request(_, {_, _, Url, DefaultHeaders}) ->
      ?_assertEqual(?SUPPORTED_METHODS,
          begin
              Headers = DefaultHeaders
                        ++ [{"Access-Control-Request-Method", "GET"}],
              {ok, _, Resp, _} = test_request:options(Url, Headers),
              proplists:get_value("Access-Control-Allow-Methods", Resp)
          end).
  
  should_make_prefligh_request_with_port({_, VHost}, {_, _, Url, _}) ->
  
negative.code:         end).
  
  should_make_preflight_request_with_auth(_, {_, _, Url, DefaultHeaders}) ->
      ?_assertEqualLists(?SUPPORTED_METHODS,
          begin
              Hashed = couch_passwords:hash_admin_password(<<"test">>),
              config:set("admins", "test", ?b2l(Hashed), false),
  