Author: fdmanana Date: Sun Sep 12 11:35:26 2010 New Revision: 996294 URL: http://svn.apache.org/viewvc?rev=996294&view=rev Log: Replicator bug fix: redirect from remote /db/_changes not properly handled (discarded user supplied HTTP Basic auth credentials) Modified: couchdb/branches/0.11.x/src/couchdb/couch_rep_changes_feed.erl Modified: couchdb/branches/0.11.x/src/couchdb/couch_rep_changes_feed.erl URL: http://svn.apache.org/viewvc/couchdb/branches/0.11.x/src/couchdb/couch_rep_changes_feed.erl?rev=996294&r1=996293&r2=996294&view=diff ============================================================================== --- couchdb/branches/0.11.x/src/couchdb/couch_rep_changes_feed.erl (original) +++ couchdb/branches/0.11.x/src/couchdb/couch_rep_changes_feed.erl Sun Sep 12 11:35:26 2010 @@ -94,7 +94,7 @@ init([_Parent, #http_db{}=Source, Since, {ok, #state{conn=Pid, last_seq=Since, reqid=ReqId, init_args=Args}}; {ibrowse_async_headers, ReqId, Code, Hdrs} when Code=="301"; Code=="302" -> catch ibrowse:stop_worker_process(Pid), - Url2 = mochiweb_headers:get_value("Location", mochiweb_headers:make(Hdrs)), + Url2 = couch_rep_httpc:redirect_url(Hdrs, Req#http_db.url), %% TODO use couch_httpc:request instead of start_http_request {Pid2, ReqId2} = start_http_request(Url2), receive {ibrowse_async_headers, ReqId2, "200", _} ->