Skip to content

Commit 28e53dd

Browse files
author
hideki
committed
Pull replicator filter not working in 1.3.0-27 against CouchDB - CBL switched to use `POST` protocol from `GET` for `/_changes` REST API. CouchDB does not support `filter` parameter in the body of POST request. It should be in query parameter.
1 parent 22fd241 commit 28e53dd

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

src/main/java/com/couchbase/lite/replicator/ChangeTracker.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,17 @@ public long getHeartbeatMilliseconds() {
184184
sb.append(limit);
185185
}
186186

187-
if (!usePOST) {
188-
// Add filter or doc_ids to URL. If sending a POST, these will go in the JSON body instead.
189-
if (docIDs != null && docIDs.size() > 0) {
190-
filterName = "_doc_ids";
191-
filterParams = new HashMap<String, Object>();
192-
filterParams.put("doc_ids", docIDs);
193-
}
194-
if (filterName != null) {
195-
sb.append("&filter=");
196-
sb.append(URLEncoder.encode(filterName));
187+
188+
if (docIDs != null && docIDs.size() > 0) {
189+
filterName = "_doc_ids";
190+
filterParams = new HashMap<String, Object>();
191+
filterParams.put("doc_ids", docIDs);
192+
}
193+
if (filterName != null) {
194+
sb.append("&filter=");
195+
sb.append(URLEncoder.encode(filterName));
196+
if (!usePOST) {
197+
// Add filter or doc_ids to URL. If sending a POST, these will go in the JSON body instead.
197198
if (filterParams != null) {
198199
for (String key : filterParams.keySet()) {
199200
Object value = filterParams.get(key);

0 commit comments

Comments
 (0)