Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

reverting accidental commit on tags

git-svn-id: https://svn.apache.org/repos/asf/couchdb/tags/0.10.0@825403 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 3de0dcf4d1563aa3f3f30b55b618dcc427f9cedb 1 parent 3e342d8
Adam Kocoloski authored
5  share/www/script/test/oauth.js
@@ -169,11 +169,6 @@ couchTests.oauth = function(debug) {
169 169
           T(xhr.status == expectedCode);
170 170
 
171 171
           // Replication
172  
-          var dbA = new CouchDB("test_suite_db_a", {
173  
-            "X-Couch-Full-Commit":"false",
174  
-            "Authorization": adminBasicAuthHeaderValue()
175  
-          });
176  
-          T(dbA.save({_id:"_design/"+i+consumerKey}).ok);
177 172
           var result = CouchDB.replicate(dbPair.source, dbPair.target, {
178 173
             headers: {"Authorization": adminBasicAuthHeaderValue()}
179 174
           });
17  src/couchdb/couch_rep_httpc.erl
@@ -110,7 +110,7 @@ process_response({ok, Status, Headers, Body}, Req) ->
110 110
     Code =:= 301; Code =:= 302 ->
111 111
         MochiHeaders = mochiweb_headers:make(Headers),
112 112
         RedirectUrl = mochiweb_headers:get_value("Location", MochiHeaders),
113  
-        do_request(redirected_request(Req, RedirectUrl));
  113
+        do_request(Req#http_db{url = RedirectUrl});
114 114
     Code =:= 409 ->
115 115
         throw(conflict);
116 116
     Code >= 400, Code < 500 ->
@@ -157,17 +157,6 @@ process_response({error, Reason}, Req) ->
157 157
         do_request(Req#http_db{retries = Retries-1, pause = 2*Pause})
158 158
     end.
159 159
 
160  
-redirected_request(Req, RedirectUrl) ->
161  
-    {Base, QStr, _} = mochiweb_util:urlsplit_path(RedirectUrl),
162  
-    QS = mochiweb_util:parse_qs(QStr),
163  
-    Hdrs = case proplists:get_value(<<"oauth">>, Req#http_db.auth) of
164  
-    undefined ->
165  
-        Req#http_db.headers;
166  
-    _Else ->
167  
-        lists:keydelete("Authorization", 1, Req#http_db.headers)
168  
-    end,
169  
-    Req#http_db{url=Base, resource="", qs=QS, headers=Hdrs}.
170  
-
171 160
 spawn_worker_process(Req) ->
172 161
     Url = ibrowse_lib:parse_url(Req#http_db.url),
173 162
     {ok, Pid} = ibrowse_http_client:start(Url),
@@ -188,9 +177,7 @@ maybe_decompress(Headers, Body) ->
188 177
     end.
189 178
 
190 179
 oauth_header(Url, QS, Action, Props) ->
191  
-    % erlang-oauth doesn't like iolists
192  
-    QSL = [{couch_util:to_list(K), ?b2l(?l2b(couch_util:to_list(V)))} ||
193  
-        {K,V} <- QS],
  180
+    QSL = [{couch_util:to_list(K), couch_util:to_list(V)} || {K,V} <- QS],
194 181
     ConsumerKey = ?b2l(proplists:get_value(<<"consumer_key">>, Props)),
195 182
     Token = ?b2l(proplists:get_value(<<"token">>, Props)),
196 183
     TokenSecret = ?b2l(proplists:get_value(<<"token_secret">>, Props)),

0 notes on commit 3de0dcf

Please sign in to comment.
Something went wrong with that request. Please try again.