couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r820344 - /couchdb/trunk/src/couchdb/couch_rep_httpc.erl
Date Wed, 30 Sep 2009 17:02:41 GMT
Author: kocolosk
Date: Wed Sep 30 17:02:41 2009
New Revision: 820344

URL: http://svn.apache.org/viewvc?rev=820344&view=rev
Log:
fix replication from DB protected by OAuth and require_valid_user=true

Modified:
    couchdb/trunk/src/couchdb/couch_rep_httpc.erl

Modified: couchdb/trunk/src/couchdb/couch_rep_httpc.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep_httpc.erl?rev=820344&r1=820343&r2=820344&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep_httpc.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep_httpc.erl Wed Sep 30 17:02:41 2009
@@ -60,9 +60,16 @@
 
 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};



Mime
View raw message