FIX: Respect query params for latest.rss (#10350)

Apparently latest.json and latest.rss are not routed to the same
controller methods. This change allows for any passed in query
parameters to actually be applied to the rss route.

This came in as a request on meta:

https://meta.discourse.org/t/-/155812/6
This commit is contained in:
Blake Erickson
2020-08-03 01:03:58 -06:00
committed by GitHub
parent ea7e7900a4
commit 4dae9d458b
2 changed files with 10 additions and 1 deletions

View File

@ -176,11 +176,13 @@ class ListController < ApplicationController
def latest_feed
discourse_expires_in 1.minute
options = { order: 'created' }.merge(build_topic_list_options)
@title = "#{SiteSetting.title} - #{I18n.t("rss_description.latest")}"
@link = "#{Discourse.base_url}/latest"
@atom_link = "#{Discourse.base_url}/latest.rss"
@description = I18n.t("rss_description.latest")
@topic_list = TopicQuery.new(nil, order: 'created').list_latest
@topic_list = TopicQuery.new(nil, options).list_latest
render 'list', formats: [:rss]
end