Rack::Deflater apparently gzip page but it appears as gibberish in browser

大憨熊 提交于 2019-12-24 08:51:16

问题


I've deployed a rails 3.1 app on the new cedar stack on heroku. The new stack doesn't automatically provide gzipping so I've added

use Rack::Deflater in my config.ru

Testing it through curl with the following command:

curl -i -H 'Accept-Encoding: gzip,deflate' http://carbuzz-production.herokuapp.com

Returns an header with content encoding gzip and a body that seems compressed. Opening the page in firefox or chrome shows the body untranslated (lots of gibberish).

Any idea how to solve this?


回答1:


This was a bit silly. Apparently rails 3.1 automatically uses Rack::Deflater so I was basically gzipping twice...

I discovered it by executing rake middleware.

I hope it helps anyway.



来源:https://stackoverflow.com/questions/8152626/rackdeflater-apparently-gzip-page-but-it-appears-as-gibberish-in-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!