Author: fdmanana
Date: Sun Sep 12 11:36:46 2010
New Revision: 996295

URL: http://svn.apache.org/viewvc?rev=996295&view=rev
Log:
Replicator bug fix: redirect from remote /db/_changes not properly handled 
(discarded user supplied HTTP Basic auth credentials)

Modified:
    couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl

Modified: couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl
URL: 
http://svn.apache.org/viewvc/couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl?rev=996295&r1=996294&r2=996295&view=diff
==============================================================================
--- couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl (original)
+++ couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl Sun Sep 12 
11:36:46 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", _} ->


Reply via email to