couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject chttpd commit: updated refs/heads/master to 2c1f3a3
Date Sat, 10 Sep 2016 18:12:48 GMT
Repository: couchdb-chttpd
Updated Branches:
  refs/heads/master c6b044006 -> 2c1f3a316


Canonicalise ETag response headers


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

Branch: refs/heads/master
Commit: 2c1f3a3167b4b667ec8cbc5a5079911a17630753
Parents: c6b0440
Author: Robert Newson <rnewson@apache.org>
Authored: Sat Sep 10 19:12:34 2016 +0100
Committer: Robert Newson <rnewson@apache.org>
Committed: Sat Sep 10 19:12:34 2016 +0100

----------------------------------------------------------------------
 src/chttpd.erl      |  2 +-
 src/chttpd_db.erl   | 10 +++++-----
 src/chttpd_misc.erl |  2 +-
 src/chttpd_show.erl |  4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/2c1f3a31/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index d0a06b6..c446eac 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -655,7 +655,7 @@ etag_respond(Req, CurrentEtag, RespFun) ->
     case etag_match(Req, CurrentEtag) of
     true ->
         % the client has this in their cache.
-        Headers = [{"Etag", CurrentEtag}],
+        Headers = [{"ETag", CurrentEtag}],
         chttpd:send_response(Req, 304, Headers, <<>>);
     false ->
         % Run the function.

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/2c1f3a31/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 3271d5b..5b672d7 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -171,7 +171,7 @@ changes_callback(start, #cacc{feed = normal} = Acc) ->
     #cacc{etag = Etag, mochi = Req} = Acc,
     FirstChunk = "{\"results\":[\n",
     {ok, Resp} = chttpd:start_delayed_json_response(Req, 200,
-        [{"Etag",Etag}], FirstChunk),
+        [{"ETag",Etag}], FirstChunk),
     {ok, Acc#cacc{mochi = Resp, responding = true}};
 changes_callback(start, Acc) ->
     #cacc{mochi = Req} = Acc,
@@ -741,7 +741,7 @@ db_doc_req(#httpd{method='POST', user_ctx=Ctx}=Req, Db, DocId) ->
     {accepted, NewRev} ->
         HttpCode = 202
     end,
-    send_json(Req, HttpCode, [{"Etag", "\"" ++ ?b2l(couch_doc:rev_to_str(NewRev)) ++ "\""}],
{[
+    send_json(Req, HttpCode, [{"ETag", "\"" ++ ?b2l(couch_doc:rev_to_str(NewRev)) ++ "\""}],
{[
         {ok, true},
         {id, DocId},
         {rev, couch_doc:rev_to_str(NewRev)}
@@ -822,7 +822,7 @@ db_doc_req(#httpd{method='COPY', user_ctx=Ctx}=Req, Db, SourceDocId) ->
     Loc = absolute_uri(Req, "/" ++ couch_util:url_encode(Db#db.name) ++ "/" ++ couch_util:url_encode(TargetDocId)),
     send_json(Req, HttpCode,
         [{"Location", Loc},
-        {"Etag", "\"" ++ ?b2l(couch_doc:rev_to_str(NewTargetRev)) ++ "\""}],
+        {"ETag", "\"" ++ ?b2l(couch_doc:rev_to_str(NewTargetRev)) ++ "\""}],
         {[{ok, true}] ++ PartRes});
 
 db_doc_req(Req, _Db, _DocId) ->
@@ -834,7 +834,7 @@ send_doc(Req, Doc, Options) ->
         DiskEtag = couch_httpd:doc_etag(Doc),
         % output etag only when we have no meta
         chttpd:etag_respond(Req, DiskEtag, fun() ->
-            send_doc_efficiently(Req, Doc, [{"Etag", DiskEtag}], Options)
+            send_doc_efficiently(Req, Doc, [{"ETag", DiskEtag}], Options)
         end);
     _ ->
         send_doc_efficiently(Req, Doc, [], Options)
@@ -950,7 +950,7 @@ send_updated_doc(#httpd{user_ctx=Ctx} = Req, Db, DocId, #doc{deleted=Deleted}=Do
     {Status, {etag, Etag}, Body} = update_doc(Db, DocId,
         #doc{deleted=Deleted}=Doc, Options),
     HttpCode = http_code_from_status(Status),
-    ResponseHeaders = [{"Etag", Etag} | Headers],
+    ResponseHeaders = [{"ETag", Etag} | Headers],
     send_json(Req, HttpCode, ResponseHeaders, Body).
 
 http_code_from_status(Status) ->

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/2c1f3a31/src/chttpd_misc.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_misc.erl b/src/chttpd_misc.erl
index 2f56f4b..03c665e 100644
--- a/src/chttpd_misc.erl
+++ b/src/chttpd_misc.erl
@@ -110,7 +110,7 @@ handle_all_dbs_req(#httpd{method='GET'}=Req) ->
     Etag = couch_httpd:make_etag({Info}),
     Options = [{user_ctx, Req#httpd.user_ctx}],
     {ok, Resp} = chttpd:etag_respond(Req, Etag, fun() ->
-        {ok, Resp} = chttpd:start_delayed_json_response(Req, 200, [{"Etag",Etag}]),
+        {ok, Resp} = chttpd:start_delayed_json_response(Req, 200, [{"ETag",Etag}]),
         VAcc = #vacc{req=Req,resp=Resp},
         fabric:all_docs(ShardDbName, Options, fun all_dbs_callback/2, VAcc, Args)
     end),

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/2c1f3a31/src/chttpd_show.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_show.erl b/src/chttpd_show.erl
index 58a9daf..356afee 100644
--- a/src/chttpd_show.erl
+++ b/src/chttpd_show.erl
@@ -240,11 +240,11 @@ apply_etag({ExternalResponse}, CurrentEtag) ->
     nil ->
         % no JSON headers
         % add our Etag and Vary headers to the response
-        {[{<<"headers">>, {[{<<"Etag">>, CurrentEtag}, {<<"Vary">>,
<<"Accept">>}]}} | ExternalResponse]};
+        {[{<<"headers">>, {[{<<"ETag">>, CurrentEtag}, {<<"Vary">>,
<<"Accept">>}]}} | ExternalResponse]};
     JsonHeaders ->
         {[case Field of
         {<<"headers">>, JsonHeaders} -> % add our headers
-            JsonHeadersEtagged = json_apply_field({<<"Etag">>, CurrentEtag},
JsonHeaders),
+            JsonHeadersEtagged = json_apply_field({<<"ETag">>, CurrentEtag},
JsonHeaders),
             JsonHeadersVaried = json_apply_field({<<"Vary">>, <<"Accept">>},
JsonHeadersEtagged),
             {<<"headers">>, JsonHeadersVaried};
         _ -> % skip non-header fields


Mime
View raw message