【发布时间】:2011-12-20 15:09:33
【问题描述】:
我已经在 rails 3.1 中设置了 unicorn,并且 http 流可以正常工作,直到我启用 Rack::Deflater。 我尝试过使用和不使用 Rack::Chunked。在 curl 中我可以看到我的响应,而在 chrome 中我收到以下错误:ERR_INVALID_CHUNKED_ENCODING
结果在其他浏览器(firefox、safari)中以及在开发(osx)和生产(heroku)之间是相同的。
config.ru:
require ::File.expand_path('../config/environment', __FILE__)
use Rack::Chunked
use Rack::Deflater
run Site::Application
独角兽.rb:
listen 3001, :tcp_nopush => false
worker_processes 1 # amount of unicorn workers to spin up
timeout 30 # restarts workers that hang for 30 seconds
控制器:
render "someview", :stream => true
感谢您的帮助。
【问题讨论】:
标签: ruby-on-rails rake unicorn http-streaming