couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [04/11] couch commit: updated refs/heads/master to 7ab7995
Date Wed, 21 May 2014 16:53:19 GMT
Configurable upper bound to _uuids count parameter


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

Branch: refs/heads/master
Commit: 0aa1ed663d758eae15469928f1b855103e6239ce
Parents: 69f881d
Author: Robert Newson <rnewson@apache.org>
Authored: Tue Mar 25 15:02:50 2014 +0000
Committer: Robert Newson <rnewson@apache.org>
Committed: Wed May 21 14:58:55 2014 +0100

----------------------------------------------------------------------
 src/couch_httpd_misc_handlers.erl | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0aa1ed66/src/couch_httpd_misc_handlers.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_misc_handlers.erl b/src/couch_httpd_misc_handlers.erl
index 9dc89ec..0a7feba 100644
--- a/src/couch_httpd_misc_handlers.erl
+++ b/src/couch_httpd_misc_handlers.erl
@@ -116,7 +116,12 @@ handle_restart_req(Req) ->
 
 
 handle_uuids_req(#httpd{method='GET'}=Req) ->
+    Max = list_to_integer(config:get("uuids","max","1000")),
     Count = list_to_integer(couch_httpd:qs_value(Req, "count", "1")),
+    case Count > Max of
+        true -> throw({forbidden, <<"count parameter too large">>});
+        false -> ok
+    end,
     UUIDs = [couch_uuids:new() || _ <- lists:seq(1, Count)],
     Etag = couch_httpd:make_etag(UUIDs),
     couch_httpd:etag_respond(Req, Etag, fun() ->


Mime
View raw message