Rack::Deflater 显然是 gzip 页面,但在浏览器中显示为乱码
我已经在heroku 上的新cedar 堆栈上部署了rails 3.1 应用程序。 新堆栈不会自动提供 gzipping,因此我
在 config.ru 中添加了 use Rack::Deflater
,
使用以下命令通过curl 进行测试:
curl -i -H 'Accept-Encoding: gzip,deflate' http://carbuzz-production.herokuapp.com
返回标头使用内容编码
gzip
和看起来压缩的正文。 在 Firefox 或 Chrome 中打开页面会显示未翻译的正文(很多乱码)。
知道如何解决这个问题吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这有点傻。显然rails 3.1自动使用Rack::Deflater所以我基本上gzipping两次......
我通过执行rake中间件发现了它。
无论如何我希望它有帮助。
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.