You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ei...@apache.org on 2017/01/18 15:35:02 UTC

[1/3] couch commit: updated refs/heads/master to 3188736

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 <ei...@eiri.ca>
Authored: Wed Jan 18 09:44:15 2017 -0400
Committer: Eric Avdey <ei...@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),


[2/3] couch commit: updated refs/heads/master to 3188736

Posted by ei...@apache.org.
Return "Bad Request" when count in /_uuids exceeds max


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

Branch: refs/heads/master
Commit: 8fd7d52093dceb87ac6535dae21a2b006d86018c
Parents: 5d79304
Author: Eric Avdey <ei...@eiri.ca>
Authored: Wed Jan 18 09:55:19 2017 -0400
Committer: Eric Avdey <ei...@eiri.ca>
Committed: Wed Jan 18 10:32:26 2017 -0400

----------------------------------------------------------------------
 src/couch_httpd_misc_handlers.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/8fd7d520/src/couch_httpd_misc_handlers.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_misc_handlers.erl b/src/couch_httpd_misc_handlers.erl
index 8d7ce5e..eb75a94 100644
--- a/src/couch_httpd_misc_handlers.erl
+++ b/src/couch_httpd_misc_handlers.erl
@@ -129,7 +129,7 @@ handle_uuids_req(#httpd{method='GET'}=Req) ->
     Max = list_to_integer(config:get("uuids","max_count","1000")),
     Count = try list_to_integer(couch_httpd:qs_value(Req, "count", "1")) of
         N when N > Max ->
-            throw({forbidden, <<"count parameter too large">>});
+            throw({bad_request, <<"count parameter too large">>});
         N when N < 0 ->
             throw({bad_request, <<"count must be a positive integer">>});
         N -> N


[3/3] couch commit: updated refs/heads/master to 3188736

Posted by ei...@apache.org.
Merge remote branch 'cloudant:validate-count-in-uuids'

This closes #221

Signed-off-by: Eric Avdey <ei...@eiri.ca>


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

Branch: refs/heads/master
Commit: 3188736c62a5d5c0a2e3079bb41fb95f94d295cf
Parents: eaff862 8fd7d52
Author: Eric Avdey <ei...@eiri.ca>
Authored: Wed Jan 18 11:34:00 2017 -0400
Committer: Eric Avdey <ei...@eiri.ca>
Committed: Wed Jan 18 11:34:00 2017 -0400

----------------------------------------------------------------------
 src/couch_httpd_misc_handlers.erl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------