mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 19:14:00 +02:00
merge revision(s) 656f25987cf2885104d5b13c8d3f5b7d32f1b333,98074a57ca9f3169fe9da9af6c49b636d37db16f,745dcf5326ea2c8e2047a3bddeb0fbb7e7d07649,b335d899fff3cc22b022c9ee2ceb636d714bf1a7: [Backport #19153]
[ruby/cgi] Fix test_cgi_cookie_new_with_domain to pass on older rubies05f0c58048
--- test/cgi/test_cgi_cookie.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) [ruby/cgi] Prepare to release 0.3.6710a647855
--- 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>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.6827b7d43cc
--- lib/cgi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
This commit is contained in:
parent
a4ab9921a1
commit
4141989b2a
4 changed files with 13 additions and 10 deletions
|
@ -288,7 +288,7 @@
|
|||
#
|
||||
|
||||
class CGI
|
||||
VERSION = "0.3.5"
|
||||
VERSION = "0.3.6"
|
||||
end
|
||||
|
||||
require 'cgi/core'
|
||||
|
|
|
@ -42,7 +42,7 @@ class CGI
|
|||
|
||||
TOKEN_RE = %r"\A[[!-~]&&[^()<>@,;:\\\"/?=\[\]{}]]+\z"
|
||||
PATH_VALUE_RE = %r"\A[[ -~]&&[^;]]*\z"
|
||||
DOMAIN_VALUE_RE = %r"\A(?<label>(?!-)[-A-Za-z0-9]+(?<!-))(?:\.\g<label>)*\z"
|
||||
DOMAIN_VALUE_RE = %r"\A\.?(?<label>(?!-)[-A-Za-z0-9]+(?<!-))(?:\.\g<label>)*\z"
|
||||
|
||||
# Create a new CGI::Cookie object.
|
||||
#
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
|
||||
#define RUBY_VERSION_TEENY 4
|
||||
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
|
||||
#define RUBY_PATCHLEVEL 188
|
||||
#define RUBY_PATCHLEVEL 189
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2022
|
||||
#define RUBY_RELEASE_MONTH 12
|
||||
#define RUBY_RELEASE_DAY 17
|
||||
#define RUBY_RELEASE_YEAR 2023
|
||||
#define RUBY_RELEASE_MONTH 2
|
||||
#define RUBY_RELEASE_DAY 23
|
||||
|
||||
#include "ruby/version.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue