* generic.rb (URI::Generic#merge, URI::Generic#route_to): Fix a bug
where a sequence of slashes in the path part gets collapsed to a
single slash. According to the relevant RFCs and WHATWG URL
Standard, empty path components are simply valid and there is no
special treatment defined for them, so we just keep them as they
are.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
https://url.spec.whatwg.org/#url-serializing
> Otherwise, if url’s host is null and url’s scheme is "file", append "//" to output.
URL spec doesn't says anything about postgres, but assume the same thing.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/uri/generic.rb (URI::Generic#find_proxy): match IP address
no_proxy against resolved self IP address. [Fix GH-1513]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
`parser` refered RFC2396_Parser, but it is separated.
test is contributed by Dominik Menke
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
We shouldn't include the bad password in the URI exception output
message. Just knowing that there is a bad password is enough
information.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
with class method.
* test/uri/test_mailto.rb: Added tests for coverage.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
only if the URI has path-rootless, not path-empty.
[ruby-core:76055] [Bug #12498]
patched by Chris Heisterkamp <cheister@squareup.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/uri/generic.rb (find_proxy): exclude white-spaces and allow
for a leading dot in the domain name in no_proxy.
[ruby-core:54542] [Feature #8317]
The previous implementation wouldn't allow for white-spaces nor a leading dot
in the domain name. The latter is described in the wget documentation as a valid case.
By being more strict on the characters, which are counted to a domainname,
we allow for white-spaces.
Also, a possible leading dot will be handled gracefully.
[Fix GH-285]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
UTF-8 as Ruby 2.2/ by Koichi ITO <koic.ito@gmail.com>
https://github.com/ruby/ruby/pull/1188 fix GH-1188
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
When you change this to true, you may need to add more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Ensure URI::Generic#to_s continues to return mutable strings to
prevent breakage when we enable frozen string literals in future
commits.
[ruby-core:71820]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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
of failing with undefined method `split' for nil:NilClass for
mailto: URIs without opaque part. [Bug #10738]
* test/uri/testuri.rb: Test for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
use hostname= to detect and wrap IPv6 hosts.
Build is accepting URI components and users may not expect
that a host component needs to be wrapped with square brackets
since it's not providing a URI.
Note: initialize with arg_check => true does not wrap IPv6 hosts.
by Joe Rafaniello <jrafanie@redhat.com>
https://github.com/ruby/ruby/pull/765 fix GH-765
* test/uri/test_generic.rb: Add more tests
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
uri doesn't respond to #to_str. [ruby-core:64453] [Bug #10150]
* test/uri/test_parser.rb: test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
assumes it is present, and will refuse all values otherwise.
by Matthew Draper <matthew@trebex.net>
https://github.com/ruby/ruby/pull/718 fix GH-718
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/uri/common.rb (URI.decode_www_form_component): use negative
look-ahead instead of nested repeat operators, to get rid of
backtrack explosion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/uri/mailto.rb (HEADER_PATTERN): removed.
* lib/uri/mailto.rb (HEADER_REGEXP): use RFC 6068 hfields.
* lib/uri/mailto.rb (EMAIL_REGEXP): use HTML5 email regexp.
* lib/uri/mailto.rb (URI::MailTo.build): support multiple to addresses.
* lib/uri/mailto.rb (URI::MailTo#initialize): Support multiple to
addresses. Don't check with regexp, only split.
* lib/uri/mailto.rb (URI::MailTo#check_to): verify by matching
URI path-rootless and HTML5 email regexp with unescaped one.
* lib/uri/mailto.rb (URI::MailTo#check_headers): verify only by
HEADER_REGEXP.
* lib/uri/mailto.rb (URI::MailTo#set_headers): don't check by
HEADER_REGEXP, only split it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
described in rdoc.
* lib/uri/rfc3986_parser.rb (regexp): implementation detail of above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
It gets encoding argument to specify the character encoding.
It now allows loose percent encoded strings, but denies ;-separator.
[ruby-core:53475] [Bug #8103]
* lib/uri/common.rb (URI.decode_www_form): follow current URL Standard.
It gets encoding argument to convert before percent encode.
Now UTF-16 strings aren't converted to UTF-8 before percent encode
by default.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e