You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2010/09/13 02:59:20 UTC
svn commit: r996401 -
/couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl
Author: fdmanana
Date: Mon Sep 13 00:59:20 2010
New Revision: 996401
URL: http://svn.apache.org/viewvc?rev=996401&view=rev
Log:
Merged revision 996399 from trunk:
Bug fix: add missing case for not preserving HTTP basic auth credentials after a redirect for _changes
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=996401&r1=996400&r2=996401&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 Mon Sep 13 00:59:20 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}};