From 1e6d3d19da2b62bfe7f8fd7827dcad3ee3fe9923 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 19 Jul 2010 10:09:56 +0000 Subject: rev + em: more easily allow Content-Length in pipe responses If a response proxying a pipe (or socket) includes a Content-Length, do not attempt to outsmart the application and just use the given Content-Length. This helps avoid exposing applications to weird internals such as env["rainbows.autochunk"] and X-Rainbows-* response headers. --- t/fast-pipe-response.ru | 2 -- 1 file changed, 2 deletions(-) (limited to 't') diff --git a/t/fast-pipe-response.ru b/t/fast-pipe-response.ru index 01f4d59..77c8d71 100644 --- a/t/fast-pipe-response.ru +++ b/t/fast-pipe-response.ru @@ -1,10 +1,8 @@ # must be run without Rack::Lint since that clobbers to_path use Rainbows::DevFdResponse run(lambda { |env| - env['rainbows.autochunk'] = false [ 200, { - 'X-Rainbows-Autochunk' => 'no', 'Content-Length' => ::File.stat('random_blob').size.to_s, 'Content-Type' => 'application/octet-stream', }, -- cgit v1.2.3-24-ge0c7