couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r996399 - /couchdb/trunk/src/couchdb/couch_rep_changes_feed.erl
Date Mon, 13 Sep 2010 00:57:28 GMT
Author: fdmanana
Date: Mon Sep 13 00:57:28 2010
New Revision: 996399

URL: http://svn.apache.org/viewvc?rev=996399&view=rev
Log:
Bug fix: add missing case for not preserving HTTP basic auth credentials after a redirect
for _changes

Modified:
    couchdb/trunk/src/couchdb/couch_rep_changes_feed.erl

Modified: couchdb/trunk/src/couchdb/couch_rep_changes_feed.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep_changes_feed.erl?rev=996399&r1=996398&r2=996399&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep_changes_feed.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep_changes_feed.erl Mon Sep 13 00:57:28 2010
@@ -257,9 +257,10 @@ handle_next_changes(_From, State) ->
 handle_headers(200, _, State) ->
     maybe_stream_next(State),
     {noreply, State};
-handle_headers(301, Hdrs, State) ->
+handle_headers(301, Hdrs, #state{init_args = InitArgs} = State) ->
     catch ibrowse:stop_worker_process(State#state.conn),
-    Url = mochiweb_headers:get_value("Location", mochiweb_headers:make(Hdrs)),
+    [_, #http_db{url = Url1} | _] = InitArgs,
+    Url = couch_rep_httpc:redirect_url(Hdrs, Url1),
     %% TODO use couch_httpc:request instead of start_http_request
     {Pid, ReqId} = start_http_request(Url),
     {noreply, State#state{conn=Pid, reqid=ReqId}};



Mime
View raw message