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.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.erl')
-rw-r--r-- | src/couchdb/couch_rep.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/couchdb/couch_rep.erl b/src/couchdb/couch_rep.erl index 92142b77..e7c57d06 100644 --- a/src/couchdb/couch_rep.erl +++ b/src/couchdb/couch_rep.erl @@ -557,7 +557,7 @@ fold_replication_logs([Db|Rest]=Dbs, Vsn, LogId, NewId, end. open_replication_log(#http_db{}=Db, DocId) -> - Req = Db#http_db{resource=couch_util:url_encode(?b2l(DocId))}, + Req = Db#http_db{resource=couch_util:encode_doc_id(DocId)}, case couch_rep_httpc:request(Req) of {[{<<"error">>, _}, {<<"reason">>, _}]} -> ?LOG_DEBUG("didn't find a replication log for ~s", [Db#http_db.url]), @@ -767,9 +767,9 @@ ensure_full_commit(Source, RequiredSeq) -> InstanceStartTime end. -update_local_doc(#http_db{} = Db, #doc{id=DocId} = Doc) -> +update_local_doc(#http_db{} = Db, Doc) -> Req = Db#http_db{ - resource = couch_util:url_encode(DocId), + resource = couch_util:encode_doc_id(Doc), method = put, body = couch_doc:to_json_obj(Doc, [attachments]), headers = [{"x-couch-full-commit", "false"} | Db#http_db.headers] |