mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/uri] Check if DN exists
https://bugs.ruby-lang.org/issues/16830 https://github.com/ruby/uri/commit/b4bf8c1217
This commit is contained in:
parent
f0b5629c8c
commit
e04418bb16
2 changed files with 5 additions and 0 deletions
|
@ -118,6 +118,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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue