Allow any 2xx code to indicate success
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/c59f8377 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/c59f8377 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/c59f8377 Branch: refs/heads/431-feature_cors Commit: c59f8377342515325049dd3156978c9b19d3e191 Parents: 547ead0 Author: Robert Newson <[email protected]> Authored: Thu Nov 8 15:32:14 2012 +0000 Committer: Jan Lehnardt <[email protected]> Committed: Sun Nov 11 20:32:02 2012 +0100 ---------------------------------------------------------------------- .../src/couch_replicator_httpc.erl | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/c59f8377/src/couch_replicator/src/couch_replicator_httpc.erl ---------------------------------------------------------------------- diff --git a/src/couch_replicator/src/couch_replicator_httpc.erl b/src/couch_replicator/src/couch_replicator_httpc.erl index 8773383..9c23595 100644 --- a/src/couch_replicator/src/couch_replicator_httpc.erl +++ b/src/couch_replicator/src/couch_replicator_httpc.erl @@ -80,7 +80,7 @@ process_response({ibrowse_req_id, ReqId}, Worker, HttpDb, Params, Callback) -> process_response({ok, Code, Headers, Body}, Worker, HttpDb, Params, Callback) -> release_worker(Worker, HttpDb), case list_to_integer(Code) of - Ok when Ok =:= 200 ; Ok =:= 201 ; (Ok >= 400 andalso Ok < 500) -> + Ok when (Ok >= 200 andalso Ok < 300) ; (Ok >= 400 andalso Ok < 500) -> EJson = case Body of <<>> -> null; @@ -102,7 +102,7 @@ process_stream_response(ReqId, Worker, HttpDb, Params, Callback) -> receive {ibrowse_async_headers, ReqId, Code, Headers} -> case list_to_integer(Code) of - Ok when Ok =:= 200 ; Ok =:= 201 ; (Ok >= 400 andalso Ok < 500) -> + Ok when (Ok >= 200 andalso Ok < 300) ; (Ok >= 400 andalso Ok < 500) -> StreamDataFun = fun() -> stream_data_self(HttpDb, Params, Worker, ReqId, Callback) end,
