diff options
author | nagachika <nagachika@ruby-lang.org> | 2023-02-23 12:41:50 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2023-02-23 12:41:50 +0900 |
commit | 4141989b2aef2993bb19140a4be355d1c68b8be1 (patch) | |
tree | 7b5dace128591b4db4853adb008afbf87248ebb4 /test | |
parent | a4ab9921a15fccca606e5f1ec741f802d39392b1 (diff) |
merge revision(s) 656f25987cf2885104d5b13c8d3f5b7d32f1b333,98074a57ca9f3169fe9da9af6c49b636d37db16f,745dcf5326ea2c8e2047a3bddeb0fbb7e7d07649,b335d899fff3cc22b022c9ee2ceb636d714bf1a7: [Backport #19153]
[ruby/cgi] Fix test_cgi_cookie_new_with_domain to pass on older
rubies
https://github.com/ruby/cgi/commit/05f0c58048
---
test/cgi/test_cgi_cookie.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[ruby/cgi] Prepare to release 0.3.6
https://github.com/ruby/cgi/commit/710a647855
---
lib/cgi.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[ruby/cgi] Loosen the domain regex to accept '.'
(https://github.com/ruby/cgi/pull/29)
* Loosen the domain regex to accept '.'
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
https://github.com/ruby/cgi/commit/5e09d632f3
Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
---
lib/cgi/cookie.rb | 2 +-
test/cgi/test_cgi_cookie.rb | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
[ruby/cgi] Bump up 0.3.6
https://github.com/ruby/cgi/commit/827b7d43cc
---
lib/cgi.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Diffstat (limited to 'test')
-rw-r--r-- | test/cgi/test_cgi_cookie.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/cgi/test_cgi_cookie.rb b/test/cgi/test_cgi_cookie.rb index e3ec4bea52..eadae45313 100644 --- a/test/cgi/test_cgi_cookie.rb +++ b/test/cgi/test_cgi_cookie.rb @@ -62,18 +62,21 @@ class CGICookieTest < Test::Unit::TestCase def test_cgi_cookie_new_with_domain h = {'name'=>'name1', 'value'=>'value1'} - cookie = CGI::Cookie.new('domain'=>'a.example.com', **h) + cookie = CGI::Cookie.new(h.merge('domain'=>'a.example.com')) assert_equal('a.example.com', cookie.domain) - cookie = CGI::Cookie.new('domain'=>'1.example.com', **h) + cookie = CGI::Cookie.new(h.merge('domain'=>'.example.com')) + assert_equal('.example.com', cookie.domain) + + cookie = CGI::Cookie.new(h.merge('domain'=>'1.example.com')) assert_equal('1.example.com', cookie.domain, 'enhanced by RFC 1123') assert_raise(ArgumentError) { - CGI::Cookie.new('domain'=>'-a.example.com', **h) + CGI::Cookie.new(h.merge('domain'=>'-a.example.com')) } assert_raise(ArgumentError) { - CGI::Cookie.new('domain'=>'a-.example.com', **h) + CGI::Cookie.new(h.merge('domain'=>'a-.example.com')) } end |