diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2009-10-15 06:29:26 +0000 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2009-10-15 06:29:26 +0000 |
commit | bc3b258fe7ae3ffee555a348066887dbe1bce8b6 (patch) | |
tree | b6f29f27224be1e8cfae6fec93530500cb75ab8b /src/couchdb/couch_rep_att.erl | |
parent | 67cddcac3997fc800aed0f73c0b28a419059ccc4 (diff) |
also fix attachment redirects
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@825407 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_rep_att.erl')
-rw-r--r-- | src/couchdb/couch_rep_att.erl | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/couchdb/couch_rep_att.erl b/src/couchdb/couch_rep_att.erl index baeb6c65..40ca4687 100644 --- a/src/couchdb/couch_rep_att.erl +++ b/src/couchdb/couch_rep_att.erl @@ -85,10 +85,8 @@ start_http_request(Req) -> 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) |