summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-06-30 17:15:34 -0700
committerEric Wong <normalperson@yhbt.net>2009-06-30 17:15:34 -0700
commitf01c1d4071e8ce30aa6806fd3cd8eec7491bf06c (patch)
tree608a0f54132da3803a5950e53093271b5fc3a8a3
parent8f648549d57df3d1b9796c70d2e11ba6ffb19486 (diff)
-rw-r--r--lib/unicorn/trailer_parser.rb4
-rw-r--r--test/unit/test_trailer_parser.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/unicorn/trailer_parser.rb b/lib/unicorn/trailer_parser.rb
index c65dc8a..9431331 100644
--- a/lib/unicorn/trailer_parser.rb
+++ b/lib/unicorn/trailer_parser.rb
@@ -40,9 +40,9 @@ module Unicorn
 
         key.tr!(TR_FR, TR_TO)
 
-        @trailers.delete(key.freeze) or
+        @trailers.delete(key) or
           raise HttpParserError, "unknown trailer: #{key.inspect}"
-        env[key] = val
+        env["HTTP_#{key}"] = val
 
         @trailers.empty? and return true
       end while true
diff --git a/test/unit/test_trailer_parser.rb b/test/unit/test_trailer_parser.rb
index e41d00f..840e9ad 100644
--- a/test/unit/test_trailer_parser.rb
+++ b/test/unit/test_trailer_parser.rb
@@ -11,7 +11,7 @@ class TestTrailerParser < Test::Unit::TestCase
     assert ! tp.execute!(env, "Content-MD5: asdf")
     assert env.empty?
     assert tp.execute!(env, "Content-MD5: asdf\r\n")
-    assert_equal 'asdf', env['CONTENT_MD5']
+    assert_equal 'asdf', env['HTTP_CONTENT_MD5']
     assert_equal 1, env.size
   end
 
@@ -29,8 +29,8 @@ class TestTrailerParser < Test::Unit::TestCase
     env = {}
     buf = "Bar: a\r\nFoo: b\r\n"
     assert tp.execute!(env, buf)
-    assert_equal 'a', env['BAR']
-    assert_equal 'b', env['FOO']
+    assert_equal 'a', env['HTTP_BAR']
+    assert_equal 'b', env['HTTP_FOO']
   end
 
   def test_too_big_key