mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/uri/mailto.rb: raising URI::InvalidComponentError instead
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
This commit is contained in:
parent
a9e033b104
commit
e3c4c7e13b
3 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
Wed Jan 14 18:06:06 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||
|
||||
* lib/uri/mailto.rb: raising URI::InvalidComponentError instead
|
||||
of failing with undefined method `split' for nil:NilClass for
|
||||
mailto: URIs without opaque part. [Bug #10738]
|
||||
* test/uri/testuri.rb: Test for above
|
||||
|
||||
Wed Jan 14 16:45:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* tool/downloader.rb (RubyGems.download): verify downloaded gem
|
||||
|
|
|
@ -135,6 +135,10 @@ module URI
|
|||
@to = nil
|
||||
@headers = []
|
||||
|
||||
unless @opaque
|
||||
raise InvalidComponentError,
|
||||
"missing opaque part for mailto URL"
|
||||
end
|
||||
to, header = @opaque.split('?', 2)
|
||||
# allow semicolon as a addr-spec separator
|
||||
# http://support.microsoft.com/kb/820868
|
||||
|
|
|
@ -104,6 +104,9 @@ class TestMailTo < Test::Unit::TestCase
|
|||
# mailto:javascript:alert()
|
||||
bad << ["javascript:alert()", []]
|
||||
|
||||
# mailto:/example.com/ ; WRONG, not a mail address
|
||||
bad << ["/example.com/", []]
|
||||
|
||||
# '=' which is in hname or hvalue is wrong.
|
||||
bad << ["foo@example.jp?subject=1+1=2", []]
|
||||
|
||||
|
|
Loading…
Reference in a new issue