Permalink
Browse files

Merge pull request #27146 from maclover7/jm-fix-27145

Do not clear HTTP_COOKIES header after request
  • Loading branch information...
eileencodes authored and rafaelfranca committed Dec 19, 2016
1 parent f078ef1 commit 7c7dacb31b506c0678843793c5bbc225294df5b1
Showing with 10 additions and 2 deletions.
  1. +0 −2 actionpack/lib/action_controller/test_case.rb
  2. +10 −0 actionpack/test/dispatch/cookies_test.rb
@@ -549,8 +549,6 @@ def process(action, *args)
@request = @controller.request
@response = @controller.response
@request.delete_header 'HTTP_COOKIE'
if @request.have_cookie_jar?
unless @request.cookie_jar.committed?
@request.cookie_jar.write(@response)
@@ -272,6 +272,10 @@ def string_key_mock
def noop
head :ok
end
def encrypted_cookie
cookies.encrypted["foo"]
end
end
tests TestController
@@ -1189,6 +1193,12 @@ def test_cookies_precedence_over_request_cookies
assert_equal 'david', cookies[:user_name]
end
def test_cookies_are_not_cleared
cookies.encrypted["foo"] = "bar"
get :noop
assert_equal "bar", @controller.encrypted_cookie
end
private
def assert_cookie_header(expected)
header = @response.headers["Set-Cookie"]

0 comments on commit 7c7dacb

Please sign in to comment.