ruby-changes:44234
From: usa <ko1@a...>
Date: Sat, 1 Oct 2016 00:57:09 +0900 (JST)
Subject: [ruby-changes:44234] usa:r56307 (ruby_2_2): merge revision(s) 56166: [Backport #12766]
usa 2016-10-01 00:57:06 +0900 (Sat, 01 Oct 2016) New Revision: 56307 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56307 Log: merge revision(s) 56166: [Backport #12766] * lib/uri/generic.rb (def check_password): don't include bad password in URI exception output * test/uri/test_generic.rb (def test_set_component): test for behavior Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/lib/uri/generic.rb branches/ruby_2_2/test/uri/test_generic.rb branches/ruby_2_2/version.h Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 56306) +++ ruby_2_2/version.h (revision 56307) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.6" #define RUBY_RELEASE_DATE "2016-10-01" -#define RUBY_PATCHLEVEL 376 +#define RUBY_PATCHLEVEL 377 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 10 Index: ruby_2_2/test/uri/test_generic.rb =================================================================== --- ruby_2_2/test/uri/test_generic.rb (revision 56306) +++ ruby_2_2/test/uri/test_generic.rb (revision 56307) @@ -741,6 +741,15 @@ class URI::TestGeneric < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/uri/test_generic.rb#L741 assert_equal('foo:xyzzy', uri.to_s) end + def test_bad_password_component + uri = URI.parse('http://foo:bar@baz') + password = 'foo@bar' + e = assert_raise(URI::InvalidComponentError) do + uri.password = password + end + refute_match password, e.message + end + def test_set_scheme uri = URI.parse 'HTTP://example' Index: ruby_2_2/lib/uri/generic.rb =================================================================== --- ruby_2_2/lib/uri/generic.rb (revision 56306) +++ ruby_2_2/lib/uri/generic.rb (revision 56307) @@ -426,7 +426,7 @@ module URI https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/uri/generic.rb#L426 if parser.regexp[:USERINFO] !~ v raise InvalidComponentError, - "bad component(expected user component): #{v}" + "bad password component" end return true Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 56306) +++ ruby_2_2/ChangeLog (revision 56307) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Sat Oct 1 00:56:19 2016 Aaron Patterson <tenderlove@r...> + + * lib/uri/generic.rb (def check_password): don't include bad password + in URI exception output + + * test/uri/test_generic.rb (def test_set_component): test for behavior + Sat Oct 1 00:55:19 2016 NAKAMURA Usaku <usa@r...> * io.c (nogvl_fsync, nogvl_fdatasync): on Windows, just ignore if the Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r56166 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/