mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 19:55:43 +00:00
We're seeing a lot of log noise coming from unhandled exceptions stemming from requests to TopicsController#show where id is passed in as an array. In the implementation of the method, we assume that if id is present it will be a string. This is because one of the routes to this action uses :id as a URL fragment, and so must be a string. However, there are other routes that go to this endpoint as well. Some of them don't have this URL fragment, so you can pass an arbitrary id query parameter. Instead of a downstream unhandled exception, we raise a Discourse::InvalidParameters upfront.