Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D7981178ED for ; Thu, 19 Feb 2015 23:41:11 +0000 (UTC) Received: (qmail 76518 invoked by uid 500); 19 Feb 2015 23:40:49 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 76463 invoked by uid 500); 19 Feb 2015 23:40:49 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 76454 invoked by uid 99); 19 Feb 2015 23:40:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Feb 2015 23:40:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8D23DE042E; Thu, 19 Feb 2015 23:40:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kxepal@apache.org To: commits@couchdb.apache.org Message-Id: <7ad3c76ef0384e7da2d5fadc0227a24d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: couch commit: updated refs/heads/master to 952a41c Date: Thu, 19 Feb 2015 23:40:49 +0000 (UTC) Repository: couchdb-couch Updated Branches: refs/heads/master aa36a185e -> 952a41c7a Consume JSON body even when its content is ignored "_ensure_full_commit" and "_compact" require that the content-type be set to "application/json". However, when some content is provided (such as "{}" in order to send a valid JSON external representation for the empty object), CouchDB needs to ensure that this content is read from the incoming HTTP request. Mirrors the fix for COUCHDB-2583 in CouchDB 1.x. This closes #36 Signed-off-by: Alexander Shorin Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/952a41c7 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/952a41c7 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/952a41c7 Branch: refs/heads/master Commit: 952a41c7a10fc4dcb0324d09c5be7e5d1d548803 Parents: aa36a18 Author: Samuel Tardieu Authored: Thu Feb 19 09:44:53 2015 +0100 Committer: Alexander Shorin Committed: Fri Feb 20 02:40:28 2015 +0300 ---------------------------------------------------------------------- src/couch_httpd_db.erl | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/952a41c7/src/couch_httpd_db.erl ---------------------------------------------------------------------- diff --git a/src/couch_httpd_db.erl b/src/couch_httpd_db.erl index 34f04f2..938521c 100644 --- a/src/couch_httpd_db.erl +++ b/src/couch_httpd_db.erl @@ -163,6 +163,7 @@ handle_compact_req(#httpd{method='POST'}=Req, Db) -> [_DbName, <<"_compact">>] -> ok = couch_db:check_is_admin(Db), couch_httpd:validate_ctype(Req, "application/json"), + _ = couch_httpd:body(Req), {ok, _} = couch_db:start_compact(Db), send_json(Req, 202, {[{ok, true}]}); [_DbName, <<"_compact">>, DesignName | _] -> @@ -269,6 +270,7 @@ db_req(#httpd{path_parts=[_DbName]}=Req, _Db) -> db_req(#httpd{method='POST',path_parts=[_,<<"_ensure_full_commit">>]}=Req, Db) -> couch_httpd:validate_ctype(Req, "application/json"), + _ = couch_httpd:body(Req), UpdateSeq = couch_db:get_update_seq(Db), CommittedSeq = couch_db:get_committed_update_seq(Db), {ok, StartTime} =