about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-09-02 18:29:58 -0700
committerEric Wong <normalperson@yhbt.net>2009-09-02 18:29:58 -0700
commit3bc7000a34c8e1788a5951381c7007f617233da2 (patch)
tree95b7ae2f08cc7d964873ffc838412fd7bbc4abda /test
parent41e3dcf47d8ee855747681b80dab1c3b9d6bc457 (diff)
downloadclogger-3bc7000a34c8e1788a5951381c7007f617233da2.tar.gz
Since Rack doesn't allow the HTTP_CONTENT_{LENGTH,TYPE} headers,
alias attempts to use those to the non-"HTTP_"-prefixed
equivalents to avoid confusion on the user side (nginx also does
this).
Diffstat (limited to 'test')
-rw-r--r--test/test_clogger.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_clogger.rb b/test/test_clogger.rb
index 4dc1371..8e6604e 100644
--- a/test/test_clogger.rb
+++ b/test/test_clogger.rb
@@ -426,4 +426,12 @@ class TestClogger < Test::Unit::TestCase
     assert_equal "5\n", str.string
   end
 
+  def test_http_content_type_fallback
+    str = StringIO.new
+    app = lambda { |env| [302, [ %w(a) ], []] }
+    cl = Clogger.new(app, :logger => str, :format => '$http_content_type')
+    cl.call(@req.merge('CONTENT_TYPE' => 'text/plain'))
+    assert_equal "text/plain\n", str.string
+  end
+
 end