Author: kocolosk
Date: Thu Oct 15 06:37:21 2009
New Revision: 825408
URL: http://svn.apache.org/viewvc?rev=825408&view=rev
Log:
also fix attachment redirects
Modified:
couchdb/branches/0.10.x/ (props changed)
couchdb/branches/0.10.x/etc/default/couchdb (props changed)
couchdb/branches/0.10.x/src/couchdb/couch_rep_att.erl
couchdb/branches/0.10.x/src/couchdb/couch_rep_httpc.erl
Propchange: couchdb/branches/0.10.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 15 06:37:21 2009
@@ -4,4 +4,4 @@
/couchdb/branches/list-iterator:782292-784593
/couchdb/branches/tail_header:775760-778477
/couchdb/tags/0.10.0:825400
-/couchdb/trunk:806983,807208-807478,807771,808574,808632,808716,808876,809134,809977,810015,810028,810350,810358,810435,811910,813803,815921,817278,817398,817400,817403,817749,817793,818249,818357,819091,819341,819343,819436,819799,819977,820344,820469,820495,820851
+/couchdb/trunk:806983,807208-807478,807771,808574,808632,808716,808876,809134,809977,810015,810028,810350,810358,810435,811910,813803,815921,817278,817398,817400,817403,817749,817793,818249,818357,819091,819341,819343,819436,819799,819977,820344,820469,820495,820851,825407
Propchange: couchdb/branches/0.10.x/etc/default/couchdb
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 15 06:37:21 2009
@@ -4,5 +4,5 @@
/couchdb/branches/list-iterator/etc/default/couchdb:782292-784593
/couchdb/branches/tail_header/etc/default/couchdb:775760-778477
/couchdb/tags/0.10.0/etc/default/couchdb:825400
-/couchdb/trunk/etc/default/couchdb:806983,807208-807478,807771,808574,808632,808716,808876,809134,809977,810015,810028,810350,810358,810435,811910,813803,815921,817277-817278,817398,817400,817403,817749,817793,818249,818357,819091,819341,819343,819436,819799,819977,820344,820469,820495,820851
+/couchdb/trunk/etc/default/couchdb:806983,807208-807478,807771,808574,808632,808716,808876,809134,809977,810015,810028,810350,810358,810435,811910,813803,815921,817277-817278,817398,817400,817403,817749,817793,818249,818357,819091,819341,819343,819436,819799,819977,820344,820469,820495,820851,825407
/incubator/couchdb/trunk/etc/default/couchdb:642419-694440
Modified: couchdb/branches/0.10.x/src/couchdb/couch_rep_att.erl
URL:
http://svn.apache.org/viewvc/couchdb/branches/0.10.x/src/couchdb/couch_rep_att.erl?rev=825408&r1=825407&r2=825408&view=diff
==============================================================================
--- couchdb/branches/0.10.x/src/couchdb/couch_rep_att.erl (original)
+++ couchdb/branches/0.10.x/src/couchdb/couch_rep_att.erl Thu Oct 15 06:37:21
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/branches/0.10.x/src/couchdb/couch_rep_httpc.erl
URL:
http://svn.apache.org/viewvc/couchdb/branches/0.10.x/src/couchdb/couch_rep_httpc.erl?rev=825408&r1=825407&r2=825408&view=diff
==============================================================================
--- couchdb/branches/0.10.x/src/couchdb/couch_rep_httpc.erl (original)
+++ couchdb/branches/0.10.x/src/couchdb/couch_rep_httpc.erl Thu Oct 15 06:37:21
2009
@@ -14,8 +14,8 @@
-include("couch_db.hrl").
-include("../ibrowse/ibrowse.hrl").
--export([db_exists/1, full_url/1, request/1, spawn_worker_process/1,
- spawn_link_worker_process/1]).
+-export([db_exists/1, 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).