MiniProfiler icon indicating copy to clipboard operation
MiniProfiler copied to clipboard

inserting Rack middleware at position 0 can cause problems with other middleware like Rack::Deflater

Open jsierles opened this issue 13 years ago • 6 comments

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)

jsierles avatar Mar 12 '13 23:03 jsierles

https://github.com/SamSaffron/MiniProfiler/issues/149

iabdulin avatar Apr 29 '13 03:04 iabdulin

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.

marcamillion avatar May 03 '13 03:05 marcamillion

any news here?

pungoyal avatar Jun 25 '13 05:06 pungoyal

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

cheeyeo avatar Jun 29 '13 15:06 cheeyeo

Facing the same problem. Tried both thin and webrick .

gsivaprasad avatar Jul 16 '13 09:07 gsivaprasad

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?

SamSaffron avatar Jul 30 '13 01:07 SamSaffron