couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r825407 - in /couchdb/trunk/src/couchdb: couch_rep_att.erl couch_rep_httpc.erl
Date Thu, 15 Oct 2009 06:29:27 GMT
Author: kocolosk
Date: Thu Oct 15 06:29:26 2009
New Revision: 825407

URL: http://svn.apache.org/viewvc?rev=825407&view=rev
Log:
also fix attachment redirects

Modified:
    couchdb/trunk/src/couchdb/couch_rep_att.erl
    couchdb/trunk/src/couchdb/couch_rep_httpc.erl

Modified: couchdb/trunk/src/couchdb/couch_rep_att.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep_att.erl?rev=825407&r1=825406&r2=825407&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep_att.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep_att.erl Thu Oct 15 06:29:26 2009
@@ -85,10 +85,8 @@
 validate_headers(_Req, 200, _Headers) ->
     ok;
 validate_headers(Req, Code, Headers) when Code > 299, Code < 400 ->
-    %% TODO check that the qs is actually included in the Location header
-    %% TODO this only supports one level of redirection
     Url = mochiweb_headers:get_value("Location",mochiweb_headers:make(Headers)),
-    NewReq = Req#http_db{url=Url, resource="", qs=[]},
+    NewReq = couch_rep_httpc:redirected_request(Req, Url),
     {ibrowse_req_id, ReqId} = couch_rep_httpc:request(NewReq),
     receive {ibrowse_async_headers, ReqId, NewCode, NewHeaders} ->
         ok = validate_headers(NewReq, list_to_integer(NewCode), NewHeaders)

Modified: couchdb/trunk/src/couchdb/couch_rep_httpc.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep_httpc.erl?rev=825407&r1=825406&r2=825407&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep_httpc.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep_httpc.erl Thu Oct 15 06:29:26 2009
@@ -14,8 +14,8 @@
 -include("couch_db.hrl").
 -include("../ibrowse/ibrowse.hrl").
 
--export([db_exists/1, db_exists/2, full_url/1, request/1, spawn_worker_process/1,
-    spawn_link_worker_process/1]).
+-export([db_exists/1, db_exists/2, full_url/1, request/1, redirected_request/2,
+    spawn_worker_process/1, spawn_link_worker_process/1]).
 
 request(Req) when is_record(Req, http_db) ->
     do_request(Req).



Mime
View raw message