summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-09-13 00:59:20 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-09-13 00:59:20 +0000
commit8f25e214452433adcf30bb7307d876f6e11b6146 (patch)
tree5e117e0df7677ec9336927a8f6d481879f403cf9 /src/couchdb
parent861616aef36e0d05c3c8fe55478a5748d7f42388 (diff)
Merged revision 996399 from trunk:
Bug fix: add missing case for not preserving HTTP basic auth credentials after a redirect for _changes git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@996401 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_rep_changes_feed.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/couchdb/couch_rep_changes_feed.erl b/src/couchdb/couch_rep_changes_feed.erl
index c67d4948..54a5f62f 100644
--- a/src/couchdb/couch_rep_changes_feed.erl
+++ b/src/couchdb/couch_rep_changes_feed.erl
@@ -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}};