FIX: Return a 404 when a sitemap request doesn't have a format (#16506)
This commit is contained in:
parent
90f4e0230e
commit
48417b59d6
|
@ -26,7 +26,7 @@ Discourse::Application.routes.draw do
|
|||
post "webhooks/sendgrid" => "webhooks#sendgrid"
|
||||
post "webhooks/sparkpost" => "webhooks#sparkpost"
|
||||
|
||||
scope path: nil, constraints: { format: :xml } do
|
||||
scope path: nil, format: true, constraints: { format: :xml } do
|
||||
resources :sitemap, only: [:index]
|
||||
get "/sitemap_:page" => "sitemap#page", page: /[1-9][0-9]*/
|
||||
get "/sitemap_recent" => "sitemap#recent"
|
||||
|
|
|
@ -12,6 +12,12 @@ describe SitemapController do
|
|||
|
||||
expect(response.status).to eq(404)
|
||||
end
|
||||
|
||||
it "returns a 404 if the request does't have a format" do
|
||||
get '/news'
|
||||
|
||||
expect(response.status).to eq(404)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#index' do
|
||||
|
|
Loading…
Reference in New Issue