From 66c4ed7957459de270cffedfd494562359386d4e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 1 Jun 2023 21:19:35 +0000 Subject: chunk unterminated HTTP/1.1 responses Rack::Chunked will be gone in Rack 3.1, so provide a non-middleware fallback which takes advantage of IO#write supporting multiple arguments in Ruby 2.5+. We still need to support Ruby 2.4, at least, since Rack 3.0 does. So a new (GC-unfriendly) Unicorn::WriteSplat module now exists for Ruby <= 2.4 users. --- lib/unicorn.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/unicorn.rb') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 1a50631..b817b77 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -66,7 +66,6 @@ module Unicorn middleware = { # order matters ContentLength: nil, - Chunked: nil, CommonLogger: [ $stderr ], ShowExceptions: nil, Lint: nil, @@ -75,8 +74,8 @@ module Unicorn # return value, matches rackup defaults based on env # Unicorn does not support persistent connections, but Rainbows! - # and Zbatery both do. Users accustomed to the Rack::Server default - # middlewares will need ContentLength/Chunked middlewares. + # does. Users accustomed to the Rack::Server default + # middlewares will need ContentLength middleware. case ENV["RACK_ENV"] when "development" when "deployment" -- cgit v1.2.3-24-ge0c7