diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-09-22 18:53:49 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-09-22 18:53:49 +0000 |
commit | 3c96e92582e2273bf6760a5b4561ad87cb62c69b (patch) | |
tree | 3b581e30d29e762d399cb97371b0273a9dfc5425 /src/couchdb/couch_rep_reader.erl | |
parent | f2cfb2fae3f0decab8485272cc939bc7821fc5a1 (diff) |
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
Diffstat (limited to 'src/couchdb/couch_rep_reader.erl')
-rw-r--r-- | src/couchdb/couch_rep_reader.erl | 6 |
1 files changed, 3 insertions, 3 deletions
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), |