From commits-return-5147-apmail-couchdb-commits-archive=couchdb.apache.org@couchdb.apache.org Mon Sep 13 00:59:59 2010 Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 64471 invoked from network); 13 Sep 2010 00:59:58 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Sep 2010 00:59:58 -0000 Received: (qmail 84879 invoked by uid 500); 13 Sep 2010 00:59:58 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 84803 invoked by uid 500); 13 Sep 2010 00:59:58 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 84795 invoked by uid 99); 13 Sep 2010 00:59:58 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 00:59:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 00:59:41 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A9BFE23889F1; Mon, 13 Sep 2010 00:59:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r996401 - /couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl Date: Mon, 13 Sep 2010 00:59:20 -0000 To: commits@couchdb.apache.org From: fdmanana@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100913005920.A9BFE23889F1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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}};