couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasondav...@apache.org
Subject svn commit: r824954 - /couchdb/trunk/src/couchdb/couch_rep_httpc.erl
Date Tue, 13 Oct 2009 22:19:37 GMT
Author: jasondavies
Date: Tue Oct 13 22:19:37 2009
New Revision: 824954

URL: http://svn.apache.org/viewvc?rev=824954&view=rev
Log:
Fix new create_target replication option when OAuth is being used.

Closes COUCHDB-525.

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=824954&r1=824953&r2=824954&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep_httpc.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep_httpc.erl Tue Oct 13 22:19:37 2009
@@ -74,18 +74,20 @@
         headers = Headers0,
         url = Url
     } = Req,
-    Headers = case proplists:get_value(<<"oauth">>, Auth) of
-    undefined ->
-        Headers0;
-    {OAuthProps} ->
-        [oauth_header(Url, [], head, OAuthProps) | Headers0]
+    HeadersFun = fun(Method) ->
+        case proplists:get_value(<<"oauth">>, Auth) of
+        undefined ->
+            Headers0;
+        {OAuthProps} ->
+            [oauth_header(Url, [], Method, OAuthProps) | Headers0]
+        end
     end,
     case CreateDB of
         true ->
-            catch ibrowse:send_req(Url, Headers, put);
+            catch ibrowse:send_req(Url, HeadersFun(put), put);
         _Else -> ok
     end,
-    case catch ibrowse:send_req(Url, Headers, head) of
+    case catch ibrowse:send_req(Url, HeadersFun(head), head) of
     {ok, "200", _, _} ->
         Req#http_db{url = CanonicalUrl};
     {ok, "301", RespHeaders, _} ->



Mime
View raw message