From bb0186cf5542bca1891e507774447588846f88d1 Mon Sep 17 00:00:00 2001 From: Fumiaki MATSUSHIMA Date: Sun, 14 Jun 2015 23:10:27 +0900 Subject: ActionDispatch::SSL should keep original header's behavior `ActionDispatch::SSL` changes headers to `Hash`. So some headers will be broken if there are some middlewares on ActionDispatch::SSL and if it uses `Rack::Utils::HeaderHash`. --- actionpack/test/dispatch/ssl_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'actionpack/test/dispatch/ssl_test.rb') diff --git a/actionpack/test/dispatch/ssl_test.rb b/actionpack/test/dispatch/ssl_test.rb index 7ced41bc2e..017e9ba2dd 100644 --- a/actionpack/test/dispatch/ssl_test.rb +++ b/actionpack/test/dispatch/ssl_test.rb @@ -216,4 +216,15 @@ class SSLTest < ActionDispatch::IntegrationTest assert_equal "https://example.co.uk/path?key=value", response.headers['Location'] end + + def test_keeps_original_headers_behavior + headers = Rack::Utils::HeaderHash.new( + "Content-Type" => "text/html", + "Connection" => ["close"] + ) + self.app = ActionDispatch::SSL.new(lambda { |env| [200, headers, ["OK"]] }) + + get "https://example.org/" + assert_equal "close", response.headers["Connection"] + end end -- cgit v1.2.3