Skip to content

Commit 02ec36e

Browse files
committed
fixed oversight bug where inspecting Net::LDAP with anonymous auth returned nil
1 parent b0bf551 commit 02ec36e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/net/ldap.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,9 @@ def paged_searches_supported?
11971197

11981198
# Mask auth password
11991199
def inspect
1200-
super.gsub @auth[:password], "*******" if @auth[:password]
1200+
inspected = super
1201+
inspected.gsub! @auth[:password], "*******" if @auth[:password]
1202+
inspected
12011203
end
12021204

12031205
private

test/test_ldap.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def test_instrument_search_with_size
6060

6161
def test_obscure_auth
6262
password = "opensesame"
63+
assert_include(@subject.inspect, "anonymous")
6364
@subject.auth "joe_user", password
6465
assert_not_include(@subject.inspect, password)
6566
end

0 commit comments

Comments
 (0)