From a6e410b7f85f22e6adbc55eb9dd3a494ca7200b2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 30 Aug 2009 22:27:25 -0700 Subject: ext: ensure headers#each in response is valid We're not Rack::Lint, but we still need to take steps to avoid segfaulting if we host non-Rack::Lint-compliant applications. This also updates the pure variant to fail on bad applications, too. --- test/test_clogger.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/test_clogger.rb b/test/test_clogger.rb index d2121da..9cb494a 100644 --- a/test/test_clogger.rb +++ b/test/test_clogger.rb @@ -373,4 +373,11 @@ class TestClogger < Test::Unit::TestCase assert_match %r{#{e}$}m, str end + def test_broken_header_response + str = StringIO.new + app = lambda { |env| [302, [ %w(a) ], []] } + cl = Clogger.new(app, :logger => str, :format => '$sent_http_set_cookie') + assert_raise(TypeError) { cl.call(@req) } + end + end -- cgit v1.2.3-24-ge0c7