Skip to content

Commit

Permalink
Fix timeout on invalid set of exclusionary parameters in `/api/v1/tim…
Browse files Browse the repository at this point in the history
…elines/public` (#26239)
  • Loading branch information
danielmbrasil committed Aug 23, 2023
1 parent b91724f commit f337008
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/public_feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def with_replies?
end

def local_only?
options[:local]
options[:local] && !options[:remote]
end

def remote_only?
options[:remote]
options[:remote] && !options[:local]
end

def account?
Expand Down
7 changes: 7 additions & 0 deletions spec/requests/api/v1/timelines/public_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@
it_behaves_like 'a successful request to the public timeline'
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
let(:params) { { only_media: true } }
let(:expected_statuses) { [media_status] }
Expand Down

0 comments on commit f337008

Please sign in to comment.