anchor.diff:              enable_cluster_http(Options)
       end.
   
  +get_remote_request_options(Options) ->
  +    case couch_util:get_value(remote_current_user, Options, undefined) of
  +        undefined ->
  +            [];
  +        _ ->
  +            [
  +                {basic_auth, {
  +                    binary_to_list(couch_util:get_value(remote_current_user, Options)),
  +                    binary_to_list(couch_util:get_value(remote_current_password, Options))
  +                }}
  +            ]
  +    end.
  +
   enable_cluster_http(Options) ->
       % POST to nodeB/_setup
  -    RequestOptions = [
  -        {basic_auth, {
  -            binary_to_list(couch_util:get_value(remote_current_user, Options)),
  -            binary_to_list(couch_util:get_value(remote_current_password, Options))
  -        }}
  -    ],
  +    RequestOptions = get_remote_request_options(Options),
   
       Body = ?JSON_ENCODE({[
           {<<"action">>, <<"enable_cluster">>},
  
positive.code: add_node_int(_Options, no) ->
      {error, cluster_not_enabled};
  add_node_int(Options, ok) ->
      couch_log:notice("add node: ~p~n", [Options]),
      ErlangCookie = erlang:get_cookie(),
  
      % POST to nodeB/_setup
  
negative.code:     case Port of
          undefined ->
              ok;
          Port when is_binary(Port) ->
              config:set("chttpd", "port", binary_to_list(Port));
          Port when is_integer(Port) ->
              config:set_integer("chttpd", "port", Port)
      end,
      couch_log:notice("Enable Cluster: ~p~n", [Options]).
      %cluster_state:set(enabled).
  