couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [03/10] couch commit: updated refs/heads/import-master-tmp to 247a772
Date Wed, 23 Apr 2014 10:25:39 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/8f0ab075
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/8f0ab075
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/8f0ab075

Branch: refs/heads/import-master-tmp
Commit: 8f0ab075d64be74c09db10a2d6243eb42499601f
Parents: 428c324
Author: Robert Newson <rnewson@apache.org>
Authored: Tue Mar 25 15:02:50 2014 +0000
Committer: Robert Newson <rnewson@apache.org>
Committed: Wed Apr 23 11:21:16 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/8f0ab075/couch_httpd_misc_handlers.erl
----------------------------------------------------------------------
diff --git a/couch_httpd_misc_handlers.erl b/couch_httpd_misc_handlers.erl
index 96a05c6..67e3a12 100644
--- a/couch_httpd_misc_handlers.erl
+++ b/couch_httpd_misc_handlers.erl
@@ -105,7 +105,12 @@ handle_restart_req(Req) ->
 
 
 handle_uuids_req(#httpd{method='GET'}=Req) ->
+    Max = list_to_integer(couch_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