summaryrefslogtreecommitdiff
path: root/src/couch_replicator/src/couch_replicator.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couch_replicator/src/couch_replicator.erl')
-rw-r--r--src/couch_replicator/src/couch_replicator.erl16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/couch_replicator/src/couch_replicator.erl b/src/couch_replicator/src/couch_replicator.erl
index 39141c301..9c7e318b6 100644
--- a/src/couch_replicator/src/couch_replicator.erl
+++ b/src/couch_replicator/src/couch_replicator.erl
@@ -144,11 +144,13 @@ replication_states() ->
-spec strip_url_creds(binary() | {[_]}) -> binary().
strip_url_creds(Endpoint) ->
- case couch_replicator_docs:parse_rep_db(Endpoint, [], []) of
- #httpdb{url=Url} ->
- iolist_to_binary(couch_util:url_strip_password(Url));
- LocalDb when is_binary(LocalDb) ->
- LocalDb
+ try
+ couch_replicator_docs:parse_rep_db(Endpoint, [], []) of
+ #httpdb{url = Url} ->
+ iolist_to_binary(couch_util:url_strip_password(Url))
+ catch
+ throw:{error, local_endpoints_not_supported} ->
+ Endpoint
end.
@@ -358,9 +360,9 @@ strip_url_creds_test_() ->
end,
fun (_) -> meck:unload() end,
[
- t_strip_local_db_creds(),
t_strip_http_basic_creds(),
- t_strip_http_props_creds()
+ t_strip_http_props_creds(),
+ t_strip_local_db_creds()
]
}.