From 82d76cd654dfed2d1c4233f9a77c3a901c510133 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 13 Feb 2009 23:53:06 -0800 Subject: HttpResponse: remove crack-addled HTTP_STATUS_HEADERS hash This also fixes a subtle bug in header generation when the +$,+ ($OFS) variable is defined to something other than nil or "" I'm really wondering what kind of drugs I was on (or _not_ on) when I modified some of this from the Mongrel source. --- test/unit/test_response.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/unit/test_response.rb b/test/unit/test_response.rb index 5d60594..c30a141 100644 --- a/test/unit/test_response.rb +++ b/test/unit/test_response.rb @@ -17,6 +17,17 @@ class ResponseTest < Test::Unit::TestCase assert out.length > 0, "output didn't have data" end + def test_response_OFS_set + old_ofs = $, + $, = "\f\v" + out = StringIO.new + HttpResponse.write(out,[200, {"X-Whatever" => "stuff"}, ["cool"]]) + resp = out.read + assert ! resp.include?("\f\v"), "output didn't use $, ($OFS)" + ensure + $, = old_ofs + end + def test_response_200 io = StringIO.new HttpResponse.write(io, [200, {}, []]) -- cgit v1.2.3-24-ge0c7