summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarren Smith <garren.smith@gmail.com>2020-04-28 10:22:58 +0200
committergarren smith <garren.smith@gmail.com>2020-04-28 13:57:06 +0200
commit19d8582ef708d18408d1fde176d43602140b65ba (patch)
tree3e2c0648ac4b60e77a179cde37b5dcc4d2bda0fd
parente889cf070a7b09a08ed7ae1ac1f7ffb716e6ef02 (diff)
downloadcouchdb-19d8582ef708d18408d1fde176d43602140b65ba.tar.gz
Remove etag from changes and _list_dbs
-rw-r--r--src/chttpd/src/chttpd_db.erl22
-rw-r--r--src/chttpd/src/chttpd_misc.erl19
2 files changed, 13 insertions, 28 deletions
diff --git a/src/chttpd/src/chttpd_db.erl b/src/chttpd/src/chttpd_db.erl
index 078009590..7cafabcc8 100644
--- a/src/chttpd/src/chttpd_db.erl
+++ b/src/chttpd/src/chttpd_db.erl
@@ -42,7 +42,6 @@
% Accumulator for changes_callback function
-record(cacc, {
- etag,
feed,
mochi,
prepend = "",
@@ -103,16 +102,12 @@ handle_changes_req_tx(#httpd{}=Req, Db) ->
Max = chttpd:chunked_response_buffer_size(),
case ChangesArgs#changes_args.feed of
"normal" ->
- Etag = <<"foo">>,
- chttpd:etag_respond(Req, Etag, fun() ->
- Acc0 = #cacc{
- feed = normal,
- etag = Etag,
- mochi = Req,
- threshold = Max
- },
- ChangesFun({fun changes_callback/2, Acc0})
- end);
+ Acc0 = #cacc{
+ feed = normal,
+ mochi = Req,
+ threshold = Max
+ },
+ ChangesFun({fun changes_callback/2, Acc0});
Feed when Feed =:= "continuous"; Feed =:= "longpoll"; Feed =:= "eventsource" ->
couch_stats:increment_counter([couchdb, httpd, clients_requesting_changes]),
Acc0 = #cacc{
@@ -183,10 +178,9 @@ changes_callback({stop, _EndSeq}, #cacc{feed = eventsource} = Acc) ->
% callbacks for longpoll and normal (single JSON Object)
changes_callback(start, #cacc{feed = normal} = Acc) ->
- #cacc{etag = Etag, mochi = Req} = Acc,
+ #cacc{mochi = Req} = Acc,
FirstChunk = "{\"results\":[\n",
- {ok, Resp} = chttpd:start_delayed_json_response(Req, 200,
- [{"ETag",Etag}], FirstChunk),
+ {ok, Resp} = chttpd:start_delayed_json_response(Req, 200, [], FirstChunk),
{ok, Acc#cacc{mochi = Resp, responding = true}};
changes_callback(start, Acc) ->
#cacc{mochi = Req} = Acc,
diff --git a/src/chttpd/src/chttpd_misc.erl b/src/chttpd/src/chttpd_misc.erl
index 843c3fe7e..565b1210c 100644
--- a/src/chttpd/src/chttpd_misc.erl
+++ b/src/chttpd/src/chttpd_misc.erl
@@ -130,20 +130,11 @@ handle_all_dbs_req(#httpd{method='GET'}=Req) ->
{skip, Skip}
],
- % Eventually the Etag for this request will be derived
- % from the \xFFmetadataVersion key in fdb
- Etag = <<"foo">>,
-
- {ok, Resp} = chttpd:etag_respond(Req, Etag, fun() ->
- {ok, Resp} = chttpd:start_delayed_json_response(Req, 200, [{"ETag",Etag}]),
- Callback = fun all_dbs_callback/2,
- Acc = #vacc{req=Req,resp=Resp},
- fabric2_db:list_dbs(Callback, Acc, Options)
- end),
- case is_record(Resp, vacc) of
- true -> {ok, Resp#vacc.resp};
- _ -> {ok, Resp}
- end;
+ {ok, Resp} = chttpd:start_delayed_json_response(Req, 200, []),
+ Callback = fun all_dbs_callback/2,
+ Acc = #vacc{req=Req,resp=Resp},
+ {ok, Acc1} = fabric2_db:list_dbs(Callback, Acc, Options),
+ {ok, Acc1#vacc.resp};
handle_all_dbs_req(Req) ->
send_method_not_allowed(Req, "GET,HEAD").