A platform for community discussion. Free, open, simple.
FIX: avoid superflous logging when mime type is bad
Sam Saffrona9f90cdec395
diff --git a/lib/middleware/discourse_public_exceptions.rb b/lib/middleware/discourse_public_exceptions.rbindex c40f319a3ae..8b9cbc827df 100644--- a/lib/middleware/discourse_public_exceptions.rb+++ b/lib/middleware/discourse_public_exceptions.rb@@ -31,12 +31,11 @@ module Middlewarefake_controller.response = responsefake_controller.request = request = ActionDispatch::Request.new(env)+ # We can not re-dispatch bad mime typesbeginrequest.formatrescue Mime::Type::InvalidMimeType- # got to do something here, we can not ship invalid format- # to the exception handler cause it will explode- request.format = "html"+ return [400, {}, ["Invalid MIME type"]]endif ApplicationController.rescue_with_handler(exception, object: fake_controller)