Permalink
Browse files

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

Do not clear HTTP_COOKIES header after request
  • Loading branch information...
eileencodes committed Dec 19, 2016
2 parents 1655b32 + 78c6c4b commit a65ccb55f234b8f218be83eb5df57f3162cf7c55
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
@@ -515,8 +515,6 @@ def process(action, method: "GET", params: {}, session: nil, body: nil, flash: {
@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 a65ccb5

Please sign in to comment.