DEV: Allow params to be passed on topic redirects (#16218)

* DEV: Allow params to be passed on topic redirects

There are several places where we redirect a url to a standard topic url
like `/t/:slug/:topic_id` but we weren't always passing query parameters
to the new url.

This change allows a few more query params to be included on the
redirect. The new params that are permitted are page, print, and
filter_top_level_replies. Any new params will need to be specified.

This also prevents the odd trailing empty page param that would
sometimes appear on a redirect. `/t/:slug/:id.json?page=`

* rubocop: fix missing space after comma

* fix another page= reference
This commit is contained in:
Blake Erickson
2022-03-17 19:27:51 -06:00
committed by GitHub
parent d678ba1103
commit 61248652cd
3 changed files with 37 additions and 4 deletions

View File

@ -649,7 +649,7 @@ describe 'topics' do
let(:external_id) { topic.external_id }
run_test! do |response|
expect(response).to redirect_to(topic.relative_url + ".json?page=")
expect(response).to redirect_to(topic.relative_url + ".json")
end
end
end