summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2009-10-15 05:49:31 +0000
committerAdam Kocoloski <kocolosk@apache.org>2009-10-15 05:49:31 +0000
commit3de0dcf4d1563aa3f3f30b55b618dcc427f9cedb (patch)
treeaecfc379adfb1e0ad16392d43f86ae3afce342e1
parent3e342d8e40d09c7dbaaaecad58e3af10a6454f03 (diff)
downloadcouchdb-0.10.0.tar.gz
reverting accidental commit on tags0.10.0
git-svn-id: https://svn.apache.org/repos/asf/couchdb/tags/0.10.0@825403 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--share/www/script/test/oauth.js5
-rw-r--r--src/couchdb/couch_rep_httpc.erl17
2 files changed, 2 insertions, 20 deletions
diff --git a/share/www/script/test/oauth.js b/share/www/script/test/oauth.js
index da3f07154..c961e21eb 100644
--- a/share/www/script/test/oauth.js
+++ b/share/www/script/test/oauth.js
@@ -169,11 +169,6 @@ couchTests.oauth = function(debug) {
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()}
});
diff --git a/src/couchdb/couch_rep_httpc.erl b/src/couchdb/couch_rep_httpc.erl
index 332876552..b9f04ab3f 100644
--- a/src/couchdb/couch_rep_httpc.erl
+++ b/src/couchdb/couch_rep_httpc.erl
@@ -110,7 +110,7 @@ process_response({ok, Status, Headers, Body}, Req) ->
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 @@ process_response({error, Reason}, Req) ->
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 @@ maybe_decompress(Headers, Body) ->
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)),