From 3c96e92582e2273bf6760a5b4561ad87cb62c69b Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Wed, 22 Sep 2010 18:53:49 +0000 Subject: Replicator: avoid percent encoding the slashes of design and local document IDs. This avoids receiving and following redirect responses from the peer. It also removes the eventual need of special rules in proxies (like Apache httpd). git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1000140 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_rep_reader.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/couchdb/couch_rep_reader.erl') diff --git a/src/couchdb/couch_rep_reader.erl b/src/couchdb/couch_rep_reader.erl index 5c824cbc..4f81c8e4 100644 --- a/src/couchdb/couch_rep_reader.erl +++ b/src/couchdb/couch_rep_reader.erl @@ -17,7 +17,7 @@ -export([start_link/4, next/1]). --import(couch_util, [url_encode/1]). +-import(couch_util, [encode_doc_id/1]). -define (BUFFER_SIZE, 1000). -define (MAX_CONCURRENT_REQUESTS, 100). @@ -234,7 +234,7 @@ open_doc_revs(#http_db{url = Url} = DbS, DocId, Revs) -> %% all this logic just splits up revision lists that are too long for %% MochiWeb into multiple requests BaseQS = [{revs,true}, {latest,true}, {att_encoding_info,true}], - BaseReq = DbS#http_db{resource=url_encode(DocId), qs=BaseQS}, + BaseReq = DbS#http_db{resource=encode_doc_id(DocId), qs=BaseQS}, BaseLength = length(couch_rep_httpc:full_url(BaseReq)) + 11, % &open_revs= {RevLists, _, _} = lists:foldl(fun split_revlist/2, @@ -264,7 +264,7 @@ open_doc_revs(#http_db{url = Url} = DbS, DocId, Revs) -> open_doc(#http_db{url = Url} = DbS, DocId) -> % get latest rev of the doc Req = DbS#http_db{ - resource=url_encode(DocId), + resource=encode_doc_id(DocId), qs=[{att_encoding_info, true}] }, {Props} = Json = couch_rep_httpc:request(Req), -- cgit v1.2.3