From 32f2b2260217bfc1f685274445eb7e1aea6a0199 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Wed, 30 Sep 2009 17:02:41 +0000 Subject: fix replication from DB protected by OAuth and require_valid_user=true git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@820344 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_rep_httpc.erl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/couchdb/couch_rep_httpc.erl b/src/couchdb/couch_rep_httpc.erl index 14219781..35334225 100644 --- a/src/couchdb/couch_rep_httpc.erl +++ b/src/couchdb/couch_rep_httpc.erl @@ -60,9 +60,16 @@ db_exists(Req) -> db_exists(Req, CanonicalUrl) -> #http_db{ - url = Url, - headers = Headers + auth = Auth, + headers = Headers0, + url = Url } = Req, + Headers = case proplists:get_value(<<"oauth">>, Auth) of + undefined -> + Headers0; + {OAuthProps} -> + [oauth_header(Url, get, OAuthProps) | Headers0] + end, case catch ibrowse:send_req(Url, Headers, head) of {ok, "200", _, _} -> Req#http_db{url = CanonicalUrl}; -- cgit v1.2.3