mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/uri/mailto.rb (initialize): RFC3986_Parser#split sets opaque
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
This commit is contained in:
parent
1e3fc7dcfa
commit
79f86a67d0
3 changed files with 16 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
|||
Sat Jul 2 18:04:24 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* lib/uri/mailto.rb (initialize): RFC3986_Parser#split sets opaque
|
||||
only if the URI has path-rootless, not path-empty.
|
||||
[ruby-core:76055] [Bug #12498]
|
||||
patched by Chris Heisterkamp <cheister@squareup.com>
|
||||
|
||||
Sat Jul 2 04:26:14 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* regcomp.c (noname_disable_map): don't optimize out group 0
|
||||
|
|
|
@ -136,6 +136,9 @@ module URI
|
|||
@to = nil
|
||||
@headers = []
|
||||
|
||||
# The RFC3986 parser does not normally populate opaque
|
||||
@opaque = "?#{@query}" if @query && !@opaque
|
||||
|
||||
unless @opaque
|
||||
raise InvalidComponentError,
|
||||
"missing opaque part for mailto URL"
|
||||
|
|
|
@ -112,13 +112,15 @@ class TestMailTo < Test::Unit::TestCase
|
|||
bad << ["foo@example.jp?subject=1+1=2", []]
|
||||
|
||||
ok.each do |x|
|
||||
assert_equal(x[0],
|
||||
@u.build(x[1]).to_s)
|
||||
assert_equal(x[0],
|
||||
@u.build(x[2]).to_s)
|
||||
assert_equal(x[0], URI.parse(x[0]).to_s)
|
||||
assert_equal(x[0], @u.build(x[1]).to_s)
|
||||
assert_equal(x[0], @u.build(x[2]).to_s)
|
||||
end
|
||||
|
||||
bad.each do |x|
|
||||
assert_raise(URI::InvalidURIError) {
|
||||
URI.parse(x)
|
||||
}
|
||||
assert_raise(URI::InvalidComponentError) {
|
||||
@u.build(x)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue