diff options
author | nagachika <nagachika@ruby-lang.org> | 2020-07-23 14:02:05 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2020-07-23 14:02:05 +0900 |
commit | 4f714939efde6d6b3b74c09e1e151e6ce6818b90 (patch) | |
tree | 2309e9bbc15519f62f8b70cf2a0e7a7983c0e274 | |
parent | 9da6470d7b3aa136b4b92469c8bbc522beb1ac31 (diff) | |
download | ruby-4f714939efde6d6b3b74c09e1e151e6ce6818b90.tar.gz |
merge revision(s) e04418bb16cd99b4a4402e7457d3bdc967284f98: [Backport #16830]
[ruby/uri] Check if DN exists
https://bugs.ruby-lang.org/issues/16830
https://github.com/ruby/uri/commit/b4bf8c1217
-rw-r--r-- | lib/uri/ldap.rb | 1 | ||||
-rw-r--r-- | test/uri/test_ldap.rb | 4 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/lib/uri/ldap.rb b/lib/uri/ldap.rb index 228c793cbd..61ec3d3f12 100644 --- a/lib/uri/ldap.rb +++ b/lib/uri/ldap.rb @@ -119,6 +119,7 @@ module URI # Private method to cleanup +dn+ from using the +path+ component attribute. def parse_dn + raise InvalidURIError, 'bad LDAP URL' unless @path @dn = @path[1..-1] end private :parse_dn diff --git a/test/uri/test_ldap.rb b/test/uri/test_ldap.rb index adad4454b5..64845e487a 100644 --- a/test/uri/test_ldap.rb +++ b/test/uri/test_ldap.rb @@ -95,6 +95,10 @@ class TestLDAP < Test::Unit::TestCase u.select(:scheme, :host, :not_exist, :port) end end + + def test_parse_invalid_uri + assert_raise(URI::InvalidURIError) {URI.parse("ldap:https://example.com")} + end end @@ -2,7 +2,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 1 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 102 +#define RUBY_PATCHLEVEL 103 #define RUBY_RELEASE_YEAR 2020 #define RUBY_RELEASE_MONTH 7 |