Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 0c0da1a6e080c7450b54150aa9bc999130e59352 1 parent b362b39
@josh josh authored
View
3  actionpack/lib/action_controller/response.rb
@@ -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
View
5 actionpack/test/controller/rack_test.rb
@@ -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 = []
View
4 actionpack/test/controller/session/cookie_store_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.