aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware/cookies.rb
diff options
context:
space:
mode:
authorJeremy Daer <jeremydaer@gmail.com>2015-10-01 18:47:13 -0700
committerJeremy Daer <jeremydaer@gmail.com>2015-10-01 18:47:13 -0700
commitbe5e6cea7380545b0bce29be3fafbff4afcb2be4 (patch)
treeceab1d6cae598834ca61c5257a56f99405ad0a8c /actionpack/lib/action_dispatch/middleware/cookies.rb
parent2c41b530b161e4974b336e8150b8b2ef475c56fe (diff)
downloadrails-be5e6cea7380545b0bce29be3fafbff4afcb2be4.tar.gz
rails-be5e6cea7380545b0bce29be3fafbff4afcb2be4.tar.bz2
rails-be5e6cea7380545b0bce29be3fafbff4afcb2be4.zip
Don't set a nil Set-Cookie header when there aren't any cookies. Omit the header.
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/cookies.rb')
-rw-r--r--actionpack/lib/action_dispatch/middleware/cookies.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb
index 7ed77352ae..2889acaeb8 100644
--- a/actionpack/lib/action_dispatch/middleware/cookies.rb
+++ b/actionpack/lib/action_dispatch/middleware/cookies.rb
@@ -396,7 +396,9 @@ module ActionDispatch
end
def write(headers)
- headers[HTTP_HEADER] = make_set_cookie_header headers[HTTP_HEADER]
+ if header = make_set_cookie_header(headers[HTTP_HEADER])
+ headers[HTTP_HEADER] = header
+ end
end
mattr_accessor :always_write_cookie