зеркало из https://github.com/github/ruby.git
* lib/uri/rfc2396_parser.rb (initialize_pattern):
URI::Generic.build should accept port as a string. pattern[:PORT] is not defined for long. by Dave Slutzkin <daveslutzkin@fastmail.fm> https://github.com/ruby/ruby/pull/804 fix GH-804 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
1443776cc9
Коммит
8c7310e713
|
@ -1,3 +1,11 @@
|
||||||
|
Tue May 19 11:22:28 2015 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/uri/rfc2396_parser.rb (initialize_pattern):
|
||||||
|
URI::Generic.build should accept port as a string.
|
||||||
|
pattern[:PORT] is not defined for long.
|
||||||
|
by Dave Slutzkin <daveslutzkin@fastmail.fm>
|
||||||
|
https://github.com/ruby/ruby/pull/804 fix GH-804
|
||||||
|
|
||||||
Tue May 19 11:18:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue May 19 11:18:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* include/ruby/ruby.h (rb_data_typed_object_alloc),
|
* include/ruby/ruby.h (rb_data_typed_object_alloc),
|
||||||
|
|
|
@ -401,7 +401,7 @@ module URI
|
||||||
# host = hostname | IPv4address | IPv6reference (RFC 2732)
|
# host = hostname | IPv4address | IPv6reference (RFC 2732)
|
||||||
ret[:HOST] = host = "(?:#{hostname}|#{ipv4addr}|#{ipv6ref})"
|
ret[:HOST] = host = "(?:#{hostname}|#{ipv4addr}|#{ipv6ref})"
|
||||||
# port = *digit
|
# port = *digit
|
||||||
port = '\d*'
|
ret[:PORT] = port = '\d*'
|
||||||
# hostport = host [ ":" port ]
|
# hostport = host [ ":" port ]
|
||||||
ret[:HOSTPORT] = hostport = "#{host}(?::#{port})?"
|
ret[:HOSTPORT] = hostport = "#{host}(?::#{port})?"
|
||||||
|
|
||||||
|
|
|
@ -761,6 +761,10 @@ class URI::TestGeneric < Test::Unit::TestCase
|
||||||
u = URI::Generic.build(['http', nil, 'example.com', 80, nil, '/foo', nil, nil, nil])
|
u = URI::Generic.build(['http', nil, 'example.com', 80, nil, '/foo', nil, nil, nil])
|
||||||
assert_equal('http://example.com:80/foo', u.to_s)
|
assert_equal('http://example.com:80/foo', u.to_s)
|
||||||
|
|
||||||
|
u = URI::Generic.build(:port => "5432")
|
||||||
|
assert_equal(":5432", u.to_s)
|
||||||
|
assert_equal(5432, u.port)
|
||||||
|
|
||||||
u = URI::Generic.build(:scheme => "http", :host => "::1", :path => "/bar/baz")
|
u = URI::Generic.build(:scheme => "http", :host => "::1", :path => "/bar/baz")
|
||||||
assert_equal("http://[::1]/bar/baz", u.to_s)
|
assert_equal("http://[::1]/bar/baz", u.to_s)
|
||||||
assert_equal("[::1]", u.host)
|
assert_equal("[::1]", u.host)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче