summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2021-04-04 22:27:35 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2021-04-04 22:27:35 +0000
commit49b37893a4189c388e51f711bd4164e1037e277b (patch)
tree81caed893f063486a3f346e86e087427ff92ee37
parent43449fb9956d568800ed62b326e478b027efe579 (diff)
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 --- lib/uri/ldap.rb | 1 + test/uri/test_ldap.rb | 4 ++++ 2 files changed, 5 insertions(+) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/uri/ldap.rb1
-rw-r--r--test/uri/test_ldap.rb4
-rw-r--r--version.h2
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
diff --git a/version.h b/version.h
index 82522cd3a4..8c108d0c70 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.6.7"
#define RUBY_RELEASE_DATE "2021-04-05"
-#define RUBY_PATCHLEVEL 173
+#define RUBY_PATCHLEVEL 174
#define RUBY_RELEASE_YEAR 2021
#define RUBY_RELEASE_MONTH 4