couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject git commit: Use default content-type application/json
Date Sat, 07 Jan 2012 14:12:56 GMT
Updated Branches:
  refs/heads/1.2.x 9fe299a59 -> 1f07088bb


Use default content-type application/json

Some requests made by the replicator were missing a
Content-Type header. By default now all requests have
a Content-Type of application/json.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/1f07088b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/1f07088b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/1f07088b

Branch: refs/heads/1.2.x
Commit: 1f07088bbe294ae0821914042bbf24aa248c5efa
Parents: 9fe299a
Author: Filipe David Borba Manana <fdmanana@apache.org>
Authored: Sat Jan 7 14:02:36 2012 +0000
Committer: Filipe David Borba Manana <fdmanana@apache.org>
Committed: Sat Jan 7 14:11:02 2012 +0000

----------------------------------------------------------------------
 src/couchdb/couch_api_wrap.erl |    7 ++-----
 src/couchdb/couch_api_wrap.hrl |    1 +
 2 files changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/1f07088b/src/couchdb/couch_api_wrap.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_api_wrap.erl b/src/couchdb/couch_api_wrap.erl
index 7c3088a..c97c6c5 100644
--- a/src/couchdb/couch_api_wrap.erl
+++ b/src/couchdb/couch_api_wrap.erl
@@ -122,8 +122,7 @@ get_db_info(#db{name = DbName, user_ctx = UserCtx}) ->
 ensure_full_commit(#httpdb{} = Db) ->
     send_req(
         Db,
-        [{method, post}, {path, "_ensure_full_commit"},
-            {headers, [{"Content-Type", "application/json"}]}],
+        [{method, post}, {path, "_ensure_full_commit"}],
         fun(201, _, {Props}) ->
             {ok, get_value(<<"instance_start_time">>, Props)};
         (_, _, {Props}) ->
@@ -288,7 +287,6 @@ update_docs(#httpdb{} = HttpDb, DocList, Options, UpdateType) ->
     end,
     Headers = [
         {"Content-Length", Len},
-        {"Content-Type", "application/json"},
         {"X-Couch-Full-Commit", FullCommit}
     ],
     send_req(
@@ -321,9 +319,8 @@ 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, Headers2}
+        {[{"filter", "_doc_ids"} | BaseQArgs], post, JsonDocIds, Headers1}
     end,
     send_req(
         HttpDb,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1f07088b/src/couchdb/couch_api_wrap.hrl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_api_wrap.hrl b/src/couchdb/couch_api_wrap.hrl
index 1a6f27a..8dd594a 100644
--- a/src/couchdb/couch_api_wrap.hrl
+++ b/src/couchdb/couch_api_wrap.hrl
@@ -17,6 +17,7 @@
     oauth = nil,
     headers = [
         {"Accept", "application/json"},
+        {"Content-Type", "application/json"},
         {"User-Agent", "CouchDB/" ++ couch_server:get_version()}
     ],
     timeout,            % milliseconds


Mime
View raw message