diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2009-09-30 17:02:41 +0000 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2009-09-30 17:02:41 +0000 |
commit | 32f2b2260217bfc1f685274445eb7e1aea6a0199 (patch) | |
tree | bcf0652cea14d15566142ac00070af8098653ab8 /src/couchdb/couch_rep_httpc.erl | |
parent | 00964d0c2978b344c1d615ee5b1625eb04507c23 (diff) |
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
Diffstat (limited to 'src/couchdb/couch_rep_httpc.erl')
-rw-r--r-- | src/couchdb/couch_rep_httpc.erl | 11 |
1 files changed, 9 insertions, 2 deletions
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}; |