FIX: do not allow unbound membership lookups

Previously we would allow looking up membership limits in an unbound way
via the API, this introduces an upper limit of 1000 per page.
This commit is contained in:
Sam Saffron
2019-06-17 15:32:06 +10:00
parent fe4f0a4369
commit 704c579550
2 changed files with 7 additions and 0 deletions

View File

@ -211,6 +211,10 @@ class GroupsController < ApplicationController
raise Discourse::InvalidParameters.new(:limit)
end
if limit > 1000
raise Discourse::InvalidParameters.new(:limit)
end
if offset < 0
raise Discourse::InvalidParameters.new(:offset)
end