diff options
author | Steve Klabnik <steve@steveklabnik.com> | 2013-07-05 07:05:31 -0700 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2013-07-05 07:05:31 -0700 |
commit | 5ade0ddfe0cb963e7d41a6b5d50e28ee9df3bc00 (patch) | |
tree | 41a8de88be05aa9d93c03280d26d8f763d9bc16f /actionpack/test | |
parent | 19f842b5fac1070849800042f8e429d3645b1828 (diff) | |
parent | ce89251bb2ff36d32e31944efed5f633eb3f7560 (diff) | |
download | rails-5ade0ddfe0cb963e7d41a6b5d50e28ee9df3bc00.tar.gz rails-5ade0ddfe0cb963e7d41a6b5d50e28ee9df3bc00.tar.bz2 rails-5ade0ddfe0cb963e7d41a6b5d50e28ee9df3bc00.zip |
Merge pull request #11131 from ykzts/fix/actiondispatch-ssl-not-required-space
Space is not required for Set-Cookie header
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/ssl_test.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/ssl_test.rb b/actionpack/test/dispatch/ssl_test.rb index 61b55f3d82..94969f795a 100644 --- a/actionpack/test/dispatch/ssl_test.rb +++ b/actionpack/test/dispatch/ssl_test.rb @@ -124,6 +124,35 @@ class SSLTest < ActionDispatch::IntegrationTest response.headers['Set-Cookie'].split("\n") end + + def test_flag_cookies_as_secure_with_has_not_spaces_before + self.app = ActionDispatch::SSL.new(lambda { |env| + headers = { + 'Content-Type' => "text/html", + 'Set-Cookie' => "problem=def; path=/;secure; HttpOnly" + } + [200, headers, ["OK"]] + }) + + get "https://example.org/" + assert_equal ["problem=def; path=/;secure; HttpOnly"], + response.headers['Set-Cookie'].split("\n") + end + + def test_flag_cookies_as_secure_with_has_not_spaces_after + self.app = ActionDispatch::SSL.new(lambda { |env| + headers = { + 'Content-Type' => "text/html", + 'Set-Cookie' => "problem=def; path=/; secure;HttpOnly" + } + [200, headers, ["OK"]] + }) + + get "https://example.org/" + assert_equal ["problem=def; path=/; secure;HttpOnly"], + response.headers['Set-Cookie'].split("\n") + end + def test_flag_cookies_as_secure_with_ignore_case self.app = ActionDispatch::SSL.new(lambda { |env| headers = { |