зеркало из https://github.com/github/ruby.git
[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:
Родитель
f0b5629c8c
Коммит
e04418bb16
|
@ -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
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче