inserting Rack middleware at position 0 can cause problems with other middleware like Rack::Deflater
On Heroku, Rack::Deflater is required to enable gzip compression on responses. Injecting the profiler before this doesn't work. It might be useful to be able to specify a position at which the middleware should be inserted.
When using the heroku-deflater gem, the actual error is:
Unexpected error while processing request: incompatible character encodings: ASCII-8BIT and UTF-8
This fixes it when run in an initializer:
config.middleware.delete(Rack::MiniProfiler)
config.middleware.insert_after(HerokuDeflater::SkipBinary, Rack::MiniProfiler)
https://github.com/SamSaffron/MiniProfiler/issues/149
I started getting this error message recently in development, and I am not using heroku-deflator.
What could be causing that?
Edit: I am using thin and the latest version of this gem.
any news here?
hi
have a similar problem in development and i'm using Rack::Cache
do i put Rack::Miniprofiler before or after Rack::Cache as it does not seem to work either way?
thanks
Facing the same problem. Tried both thin and webrick .
I am open to a patch that has the railstie check for Heorku::Deflater or Rack::Defalter and insterts after them if they are there.
Anyone care to give it a shot?