diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-08-30 22:27:26 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-09-01 11:30:31 -0700 |
commit | c9f68fc6294a59c31728bab9e01350c4b271fe30 (patch) | |
tree | 8932e18bf8e8c1c07161c08f9405ebf142ff873d /test/test_clogger.rb | |
parent | a6e410b7f85f22e6adbc55eb9dd3a494ca7200b2 (diff) | |
download | clogger-c9f68fc6294a59c31728bab9e01350c4b271fe30.tar.gz |
The pure variant was using lower-case output instead of upper case, the ext variant was actually fine in this case. This is for nginx output format compatibility.
Diffstat (limited to 'test/test_clogger.rb')
-rw-r--r-- | test/test_clogger.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_clogger.rb b/test/test_clogger.rb index 9cb494a..5e85e15 100644 --- a/test/test_clogger.rb +++ b/test/test_clogger.rb @@ -333,6 +333,18 @@ class TestClogger < Test::Unit::TestCase assert_equal expect, str.string end + # rack allows repeated headers with "\n": + # { 'Set-Cookie' => "a\nb" } => + # Set-Cookie: a + # Set-Cookie: b + def test_escape_header_newlines + str = StringIO.new + app = lambda { |env| [302, { 'Set-Cookie' => "a\nb" }, [] ] } + cl = Clogger.new(app, :logger => str, :format => '$sent_http_set_cookie') + cl.call(@req) + assert_equal "a\\x0Ab\n", str.string + end + def test_request_uri_fallback str = StringIO.new app = lambda { |env| [ 200, {}, [] ] } |