mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
DEV: Validate before and bumped_before options in TopicQuery (#23451)
This commit is contained in:
parent
93c32b9e07
commit
ad58b6d604
@ -19,6 +19,8 @@ class TopicQuery
|
||||
array_or_string = lambda { |x| Array === x || String === x }
|
||||
|
||||
{
|
||||
before: zero_up_to_max_int,
|
||||
bumped_before: zero_up_to_max_int,
|
||||
max_posts: zero_up_to_max_int,
|
||||
min_posts: zero_up_to_max_int,
|
||||
page: zero_up_to_max_int,
|
||||
|
@ -33,6 +33,12 @@ RSpec.describe ListController do
|
||||
|
||||
get "/latest?tags[1]=hello"
|
||||
expect(response.status).to eq(400)
|
||||
|
||||
get "/latest?before[1]=haxx"
|
||||
expect(response.status).to eq(400)
|
||||
|
||||
get "/latest?bumped_before[1]=haxx"
|
||||
expect(response.status).to eq(400)
|
||||
end
|
||||
|
||||
it "returns 200 for legit requests" do
|
||||
|
Loading…
Reference in New Issue
Block a user