couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r825403 - in /couchdb/tags/0.10.0: share/www/script/test/oauth.js src/couchdb/couch_rep_httpc.erl
Date Thu, 15 Oct 2009 05:49:31 GMT
Author: kocolosk
Date: Thu Oct 15 05:49:31 2009
New Revision: 825403

URL: http://svn.apache.org/viewvc?rev=825403&view=rev
Log:
reverting accidental commit on tags

Modified:
    couchdb/tags/0.10.0/share/www/script/test/oauth.js
    couchdb/tags/0.10.0/src/couchdb/couch_rep_httpc.erl

Modified: couchdb/tags/0.10.0/share/www/script/test/oauth.js
URL: http://svn.apache.org/viewvc/couchdb/tags/0.10.0/share/www/script/test/oauth.js?rev=825403&r1=825402&r2=825403&view=diff
==============================================================================
--- couchdb/tags/0.10.0/share/www/script/test/oauth.js (original)
+++ couchdb/tags/0.10.0/share/www/script/test/oauth.js Thu Oct 15 05:49:31 2009
@@ -169,11 +169,6 @@
           T(xhr.status == expectedCode);
 
           // Replication
-          var dbA = new CouchDB("test_suite_db_a", {
-            "X-Couch-Full-Commit":"false",
-            "Authorization": adminBasicAuthHeaderValue()
-          });
-          T(dbA.save({_id:"_design/"+i+consumerKey}).ok);
           var result = CouchDB.replicate(dbPair.source, dbPair.target, {
             headers: {"Authorization": adminBasicAuthHeaderValue()}
           });

Modified: couchdb/tags/0.10.0/src/couchdb/couch_rep_httpc.erl
URL: http://svn.apache.org/viewvc/couchdb/tags/0.10.0/src/couchdb/couch_rep_httpc.erl?rev=825403&r1=825402&r2=825403&view=diff
==============================================================================
--- couchdb/tags/0.10.0/src/couchdb/couch_rep_httpc.erl (original)
+++ couchdb/tags/0.10.0/src/couchdb/couch_rep_httpc.erl Thu Oct 15 05:49:31 2009
@@ -110,7 +110,7 @@
     Code =:= 301; Code =:= 302 ->
         MochiHeaders = mochiweb_headers:make(Headers),
         RedirectUrl = mochiweb_headers:get_value("Location", MochiHeaders),
-        do_request(redirected_request(Req, RedirectUrl));
+        do_request(Req#http_db{url = RedirectUrl});
     Code =:= 409 ->
         throw(conflict);
     Code >= 400, Code < 500 ->
@@ -157,17 +157,6 @@
         do_request(Req#http_db{retries = Retries-1, pause = 2*Pause})
     end.
 
-redirected_request(Req, RedirectUrl) ->
-    {Base, QStr, _} = mochiweb_util:urlsplit_path(RedirectUrl),
-    QS = mochiweb_util:parse_qs(QStr),
-    Hdrs = case proplists:get_value(<<"oauth">>, Req#http_db.auth) of
-    undefined ->
-        Req#http_db.headers;
-    _Else ->
-        lists:keydelete("Authorization", 1, Req#http_db.headers)
-    end,
-    Req#http_db{url=Base, resource="", qs=QS, headers=Hdrs}.
-
 spawn_worker_process(Req) ->
     Url = ibrowse_lib:parse_url(Req#http_db.url),
     {ok, Pid} = ibrowse_http_client:start(Url),
@@ -188,9 +177,7 @@
     end.
 
 oauth_header(Url, QS, Action, Props) ->
-    % erlang-oauth doesn't like iolists
-    QSL = [{couch_util:to_list(K), ?b2l(?l2b(couch_util:to_list(V)))} ||
-        {K,V} <- QS],
+    QSL = [{couch_util:to_list(K), couch_util:to_list(V)} || {K,V} <- QS],
     ConsumerKey = ?b2l(proplists:get_value(<<"consumer_key">>, Props)),
     Token = ?b2l(proplists:get_value(<<"token">>, Props)),
     TokenSecret = ?b2l(proplists:get_value(<<"token_secret">>, Props)),



Mime
View raw message