Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jsierles opened this issue Mar 12, 2013 · 6 comments

Comments

@jsierles
Copy link

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)
@iabdulin
Copy link

#149

@marcamillion
Copy link

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.

@pungoyal
Copy link

any news here?

@cheeyeo
Copy link

cheeyeo commented Jun 29, 2013

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

@gsivaprasad
Copy link

Facing the same problem. Tried both thin and webrick .

@SamSaffron
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants