diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-08-23 17:55:53 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-08-23 17:55:53 +0000 |
commit | f2827a1208dd612558bd036c4f8244eb747f3c25 (patch) | |
tree | 34405f2886b55b5fcbfd2c74cc73469603a8d958 | |
parent | e6f647b02d54f3fcbee80f75273533630434ea51 (diff) |
Merged revision 988233 from trunk:
Replicator: fix authentication failure when replicating design documents that have attachments.
Closes COUCHDB-868.
Patch by Jason Smith, thanks.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@988234 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/couchdb/couch_rep_att.erl | 2 | ||||
-rw-r--r-- | src/couchdb/couch_rep_httpc.erl | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/couchdb/couch_rep_att.erl b/src/couchdb/couch_rep_att.erl index 28b8945c..3c09b90a 100644 --- a/src/couchdb/couch_rep_att.erl +++ b/src/couchdb/couch_rep_att.erl @@ -106,7 +106,7 @@ validate_headers(_Req, 200, Headers) -> MochiHeaders = mochiweb_headers:make(Headers), {ok, mochiweb_headers:get_value("Content-Encoding", MochiHeaders)}; validate_headers(Req, Code, Headers) when Code > 299, Code < 400 -> - Url = mochiweb_headers:get_value("Location",mochiweb_headers:make(Headers)), + Url = couch_rep_httpc:redirect_url(Headers, Req#http_db.url), NewReq = couch_rep_httpc:redirected_request(Req, Url), {ibrowse_req_id, ReqId} = couch_rep_httpc:request(NewReq), receive {ibrowse_async_headers, ReqId, NewCode, NewHeaders} -> diff --git a/src/couchdb/couch_rep_httpc.erl b/src/couchdb/couch_rep_httpc.erl index 768d88a3..ff25e4d5 100644 --- a/src/couchdb/couch_rep_httpc.erl +++ b/src/couchdb/couch_rep_httpc.erl @@ -15,7 +15,7 @@ -include("../ibrowse/ibrowse.hrl"). -export([db_exists/1, db_exists/2, full_url/1, request/1, redirected_request/2, - spawn_worker_process/1, spawn_link_worker_process/1]). + redirect_url/2, spawn_worker_process/1, spawn_link_worker_process/1]). request(#http_db{} = Req) -> do_request(Req). |