From ba72b12030864a05fc88bc94a3b699971cc70b0a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 5 Dec 2011 17:53:43 -0800 Subject: escape bytes in the 0x7F-0xFF range, too This matches the behavior of nginx 1.0.9 --- test/test_clogger.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/test_clogger.rb b/test/test_clogger.rb index 35a211a..10640e2 100644 --- a/test/test_clogger.rb +++ b/test/test_clogger.rb @@ -390,6 +390,15 @@ class TestClogger < Test::Unit::TestCase assert_equal "a\\x0Ab\n", str.string end + def test_escape_crazy_delete + str = StringIO.new + app = lambda { |env| [302, {}, [] ] } + cl = Clogger.new(app, :logger => str, :format => "$http_cookie") + @req["HTTP_COOKIE"] = "a\x7f\xff" + cl.call(@req) + assert_equal "a\\x7F\\xFF\n", str.string + end + def test_request_uri_fallback str = StringIO.new app = lambda { |env| [ 200, {}, [] ] } -- cgit v1.2.3-24-ge0c7