heroku_rails_deflate icon indicating copy to clipboard operation
heroku_rails_deflate copied to clipboard

Doesn't play nicely with rack-mini-profiler

Open JacobEvelyn opened this issue 9 years ago • 0 comments

rack-mini-profiler needs to be added at a specific point in relation to this middleware (it injects HTML into the view). Unfortunately, because of the way this gem adds middleware after all other middleware has been added (:after => :load_config_initializers), rack-mini-profiler can't insert itself correctly via an initializer as is the standard practice.

Is there a reason this gem can't use the same pattern? In production (at least in Rails), app.config.middleware invokes a wrapper object around the actual middleware object, storing commands for manipulating the order of the middleware and invoking them all once the actual classes are loaded. That seems like it would allow this gem to use the same pattern, but I confess I don't know a ton about middleware and was planning on digging in more deeply tomorrow.

JacobEvelyn avatar Dec 01 '15 22:12 JacobEvelyn