couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [1/3] couch commit: updated refs/heads/master to 3188736
Date Wed, 18 Jan 2017 15:35:02 GMT
Repository: couchdb-couch
Updated Branches:
  refs/heads/master eaff862e6 -> 3188736c6


Validate that count in /_uuids is positive


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

Branch: refs/heads/master
Commit: 5d7930461f420683276dddc02a7fd4410c1b5439
Parents: eaff862
Author: Eric Avdey <eiri@eiri.ca>
Authored: Wed Jan 18 09:44:15 2017 -0400
Committer: Eric Avdey <eiri@eiri.ca>
Committed: Wed Jan 18 10:32:19 2017 -0400

----------------------------------------------------------------------
 src/couch_httpd_misc_handlers.erl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/5d793046/src/couch_httpd_misc_handlers.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_misc_handlers.erl b/src/couch_httpd_misc_handlers.erl
index 0cbbdd8..8d7ce5e 100644
--- a/src/couch_httpd_misc_handlers.erl
+++ b/src/couch_httpd_misc_handlers.erl
@@ -130,10 +130,12 @@ handle_uuids_req(#httpd{method='GET'}=Req) ->
     Count = try list_to_integer(couch_httpd:qs_value(Req, "count", "1")) of
         N when N > Max ->
             throw({forbidden, <<"count parameter too large">>});
+        N when N < 0 ->
+            throw({bad_request, <<"count must be a positive integer">>});
         N -> N
     catch
         error:badarg ->
-            throw({bad_request, <<"count parameter is not an integer">>})
+            throw({bad_request, <<"count must be a positive integer">>})
     end,
     UUIDs = [couch_uuids:new() || _ <- lists:seq(1, Count)],
     Etag = couch_httpd:make_etag(UUIDs),


Mime
View raw message