From 8f25e214452433adcf30bb7307d876f6e11b6146 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Mon, 13 Sep 2010 00:59:20 +0000 Subject: 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 --- src/couchdb/couch_rep_changes_feed.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/couchdb') 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}}; -- cgit v1.2.3