aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-03-19 12:40:41 -0700
committerJosé Valim <jose.valim@gmail.com>2012-03-19 12:40:41 -0700
commitae977150e7beaa6a45960288acea3801b98639f7 (patch)
treec6db5898cdbd709f10c02e6691600474d2d59335 /actionpack/test
parent09d884cd2cb8f49f0899864cd42649a3bf403872 (diff)
parent6e04a78462cc41160c094f79cb3433051c38369f (diff)
downloadrails-ae977150e7beaa6a45960288acea3801b98639f7.tar.gz
rails-ae977150e7beaa6a45960288acea3801b98639f7.tar.bz2
rails-ae977150e7beaa6a45960288acea3801b98639f7.zip
Merge pull request #5515 from rafaelfranca/remove-exclude
Remove exclude option from ActionDispatch::SSL and fix secure cookies
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/ssl_test.rb34
1 files changed, 28 insertions, 6 deletions
diff --git a/actionpack/test/dispatch/ssl_test.rb b/actionpack/test/dispatch/ssl_test.rb
index b1463f31cf..6f075a9074 100644
--- a/actionpack/test/dispatch/ssl_test.rb
+++ b/actionpack/test/dispatch/ssl_test.rb
@@ -31,12 +31,6 @@ class SSLTest < ActionDispatch::IntegrationTest
response.headers['Location']
end
- def test_exclude_from_redirect
- self.app = ActionDispatch::SSL.new(default_app, :exclude => lambda { |env| true })
- get "http://example.org/"
- assert_response :success
- end
-
def test_hsts_header_by_default
get "https://example.org/"
assert_equal "max-age=31536000",
@@ -90,6 +84,34 @@ class SSLTest < ActionDispatch::IntegrationTest
response.headers['Set-Cookie'].split("\n")
end
+ def test_flag_cookies_as_secure_with_more_spaces_before
+ self.app = ActionDispatch::SSL.new(lambda { |env|
+ headers = {
+ 'Content-Type' => "text/html",
+ 'Set-Cookie' => "problem=def; path=/; HttpOnly; secure"
+ }
+ [200, headers, ["OK"]]
+ })
+
+ get "https://example.org/"
+ assert_equal ["problem=def; path=/; HttpOnly; secure"],
+ response.headers['Set-Cookie'].split("\n")
+ end
+
+ def test_flag_cookies_as_secure_with_more_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_no_cookies
self.app = ActionDispatch::SSL.new(lambda { |env|
[200, {'Content-Type' => "text/html"}, ["OK"]]