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 5D3B49F36 for ; Sat, 7 Jan 2012 20:22:40 +0000 (UTC) Received: (qmail 11162 invoked by uid 500); 7 Jan 2012 20:22:40 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 11039 invoked by uid 500); 7 Jan 2012 20:22:39 -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 11032 invoked by uid 99); 7 Jan 2012 20:22:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jan 2012 20:22:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.114] (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jan 2012 20:22:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9298B535B2; Sat, 7 Jan 2012 20:22:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: fdmanana@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: Don't send Content-Type in GET/HEAD requests Message-Id: <20120107202217.9298B535B2@tyr.zones.apache.org> Date: Sat, 7 Jan 2012 20:22:17 +0000 (UTC) Updated Branches: refs/heads/master eedf901f7 -> 8f0b4e64f Don't send Content-Type in GET/HEAD requests This partially reverts 55d2c9e390cf06a76ff6715a60b85f8f4ca26f97, adding only a Content-Type of application/json to post requests against _revs_diff. Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/8f0b4e64 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/8f0b4e64 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/8f0b4e64 Branch: refs/heads/master Commit: 8f0b4e64f38a9b337d84a9637692c6920ab2d114 Parents: eedf901 Author: Filipe David Borba Manana Authored: Sat Jan 7 19:49:39 2012 +0000 Committer: Filipe David Borba Manana Committed: Sat Jan 7 20:10:48 2012 +0000 ---------------------------------------------------------------------- .../src/couch_replicator_api_wrap.erl | 10 +++++++--- .../src/couch_replicator_api_wrap.hrl | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/8f0b4e64/src/couch_replicator/src/couch_replicator_api_wrap.erl ---------------------------------------------------------------------- diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl b/src/couch_replicator/src/couch_replicator_api_wrap.erl index c3bcdab..42f393e 100644 --- a/src/couch_replicator/src/couch_replicator_api_wrap.erl +++ b/src/couch_replicator/src/couch_replicator_api_wrap.erl @@ -121,7 +121,8 @@ get_db_info(#db{name = DbName, user_ctx = UserCtx}) -> ensure_full_commit(#httpdb{} = Db) -> send_req( Db, - [{method, post}, {path, "_ensure_full_commit"}], + [{method, post}, {path, "_ensure_full_commit"}, + {headers, [{"Content-Type", "application/json"}]}], fun(201, _, {Props}) -> {ok, get_value(<<"instance_start_time">>, Props)}; (_, _, {Props}) -> @@ -135,7 +136,8 @@ get_missing_revs(#httpdb{} = Db, IdRevs) -> JsonBody = {[{Id, couch_doc:revs_to_strs(Revs)} || {Id, Revs} <- IdRevs]}, send_req( Db, - [{method, post}, {path, "_revs_diff"}, {body, ?JSON_ENCODE(JsonBody)}], + [{method, post}, {path, "_revs_diff"}, {body, ?JSON_ENCODE(JsonBody)}, + {headers, [{"Content-Type", "application/json"}]}], fun(200, _, {Props}) -> ConvertToNativeFun = fun({Id, {Result}}) -> MissingRevs = couch_doc:parse_revs( @@ -286,6 +288,7 @@ update_docs(#httpdb{} = HttpDb, DocList, Options, UpdateType) -> end, Headers = [ {"Content-Length", Len}, + {"Content-Type", "application/json"}, {"X-Couch-Full-Commit", FullCommit} ], send_req( @@ -320,8 +323,9 @@ changes_since(#httpdb{headers = Headers1} = HttpDb, Style, StartSeq, QArgs1 = maybe_add_changes_filter_q_args(BaseQArgs, Options), {QArgs1, get, [], Headers1}; _ when is_list(DocIds) -> + Headers2 = [{"Content-Type", "application/json"} | Headers1], JsonDocIds = ?JSON_ENCODE({[{<<"doc_ids">>, DocIds}]}), - {[{"filter", "_doc_ids"} | BaseQArgs], post, JsonDocIds, Headers1} + {[{"filter", "_doc_ids"} | BaseQArgs], post, JsonDocIds, Headers2} end, send_req( HttpDb, http://git-wip-us.apache.org/repos/asf/couchdb/blob/8f0b4e64/src/couch_replicator/src/couch_replicator_api_wrap.hrl ---------------------------------------------------------------------- diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.hrl b/src/couch_replicator/src/couch_replicator_api_wrap.hrl index 8dd594a..1a6f27a 100644 --- a/src/couch_replicator/src/couch_replicator_api_wrap.hrl +++ b/src/couch_replicator/src/couch_replicator_api_wrap.hrl @@ -17,7 +17,6 @@ oauth = nil, headers = [ {"Accept", "application/json"}, - {"Content-Type", "application/json"}, {"User-Agent", "CouchDB/" ++ couch_server:get_version()} ], timeout, % milliseconds