Permalink
Browse files

Fix empty Set-Cookie headers [#3811 state:resolved]

  • Loading branch information...
josh committed Feb 2, 2010
1 parent b362b39 commit 0c0da1a6e080c7450b54150aa9bc999130e59352
@@ -233,7 +233,8 @@ def convert_language!
end
def convert_cookies!
- headers['Set-Cookie'] = Array(headers['Set-Cookie']).compact
+ cookies = Array(headers['Set-Cookie']).compact
+ headers['Set-Cookie'] = cookies unless cookies.empty?
end
end
end
@@ -219,7 +219,6 @@ def test_simple_output
"Content-Type" => "text/html; charset=utf-8",
"Cache-Control" => "private, max-age=0, must-revalidate",
"ETag" => '"65a8e27d8879283831b664bd8b7f0ad4"',
- "Set-Cookie" => "",
"Content-Length" => "13"
}, headers)
@@ -238,7 +237,6 @@ def test_utf8_output
"Content-Type" => "text/html; charset=utf-8",
"Cache-Control" => "private, max-age=0, must-revalidate",
"ETag" => '"ebb5e89e8a94e9dd22abf5d915d112b2"',
- "Set-Cookie" => "",
"Content-Length" => "8"
}, headers)
end
@@ -253,8 +251,7 @@ def test_streaming_block
assert_equal 200, status
assert_equal({
"Content-Type" => "text/html; charset=utf-8",
- "Cache-Control" => "no-cache",
- "Set-Cookie" => ""
+ "Cache-Control" => "no-cache"
}, headers)
parts = []
@@ -145,7 +145,7 @@ def test_doesnt_write_session_cookie_if_session_is_not_accessed
with_test_route_set do
get '/no_session_access'
assert_response :success
- assert_equal "", headers['Set-Cookie']
+ assert_equal nil, headers['Set-Cookie']
end
end
@@ -155,7 +155,7 @@ def test_doesnt_write_session_cookie_if_session_is_unchanged
"fef868465920f415f2c0652d6910d3af288a0367"
get '/no_session_access'
assert_response :success
- assert_equal "", headers['Set-Cookie']
+ assert_equal nil, headers['Set-Cookie']
end
end

0 comments on commit 0c0da1a

Please sign in to comment.