From 3cd5ab380afa9956e8d40a1feb0ef201131adf49 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 17 Jan 2019 23:47:21 +0100 Subject: [PATCH] Fix: Host already had the port attached This happened when providing a port number in the URI as the `Host` field still has the port number while the `Hostname()` method only returns the hostname without the port. fixes #33 Signed-off-by: Knut Ahlers --- auth_ldap.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth_ldap.go b/auth_ldap.go index 1799d58a..98a1e3d3 100644 --- a/auth_ldap.go +++ b/auth_ldap.go @@ -262,7 +262,7 @@ func (a authLDAP) dial() (*ldap.Conn, error) { return nil, err } - host := u.Host + host := u.Hostname() port := u.Port() var l *ldap.Conn