mirror of https://github.com/tootsuite/mastodon
Fix timeout on invalid set of exclusionary parameters in `/api/v1/timelines/public` (#26239)
parent
b91724fb9d
commit
f337008819
|
@ -45,11 +45,11 @@ class PublicFeed
|
||||||
end
|
end
|
||||||
|
|
||||||
def local_only?
|
def local_only?
|
||||||
options[:local]
|
options[:local] && !options[:remote]
|
||||||
end
|
end
|
||||||
|
|
||||||
def remote_only?
|
def remote_only?
|
||||||
options[:remote]
|
options[:remote] && !options[:local]
|
||||||
end
|
end
|
||||||
|
|
||||||
def account?
|
def account?
|
||||||
|
|
|
@ -56,6 +56,13 @@ describe 'Public' do
|
||||||
it_behaves_like 'a successful request to the public timeline'
|
it_behaves_like 'a successful request to the public timeline'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with local and remote params' do
|
||||||
|
let(:params) { { local: true, remote: true } }
|
||||||
|
let(:expected_statuses) { [local_status, remote_status, media_status] }
|
||||||
|
|
||||||
|
it_behaves_like 'a successful request to the public timeline'
|
||||||
|
end
|
||||||
|
|
||||||
context 'with only_media param' do
|
context 'with only_media param' do
|
||||||
let(:params) { { only_media: true } }
|
let(:params) { { only_media: true } }
|
||||||
let(:expected_statuses) { [media_status] }
|
let(:expected_statuses) { [media_status] }
|
||||||
|
|
Loading…
Reference in New Issue