From 939b82ef0cb80717baee8fd80351d7dba41582be Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 13 Dec 2018 18:27:02 +1100 Subject: [PATCH] DEV: correct intermittent test failure ActionController::BadRequest can not be re-dispatched, under some conditions we are getting this vs InvalidParameterError in the following test https://github.com/discourse/discourse/blob/59c56bd20f4adc00732d712c6ec81a9239bc24ae/spec/requests/application_controller_spec.rb#L34-L62 --- lib/middleware/discourse_public_exceptions.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/middleware/discourse_public_exceptions.rb b/lib/middleware/discourse_public_exceptions.rb index de34d61cb3e..089366d438d 100644 --- a/lib/middleware/discourse_public_exceptions.rb +++ b/lib/middleware/discourse_public_exceptions.rb @@ -20,6 +20,9 @@ module Middleware # the Request object has a "broken" .params which can not be accessed exception = nil if Rack::QueryParser::InvalidParameterError === exception + # We also can not dispatch bad requests as no proper params + exception = nil if ActionController::BadRequest === exception + if exception begin fake_controller = ApplicationController.new