Skip to content

Commit 183b868

Browse files
committed
Use IP address only to avoid blocking DNS lookupsadd error
1 parent 7c7bfe6 commit 183b868

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/main/java/hudson/plugins/active_directory/ActiveDirectoryUnixAuthenticationProvider.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -810,10 +810,10 @@ private void parseMembers(String userDN, Set<GrantedAuthority> groups, NamingEnu
810810

811811

812812
/**
813-
* Safely extracts the source IP address and hostname from the current HTTP request.
813+
* Safely extracts the source IP address from the current HTTP request.
814814
* Returns an empty string if the request context is not available.
815815
*
816-
* @return A formatted string with source information (e.g., " from 192.168.1.100 (hostname.domain.com)")
816+
* @return A formatted string with source IP (e.g., " from 192.168.1.100")
817817
* or an empty string if request information is unavailable
818818
*/
819819
private String getSourceInfo() {
@@ -824,13 +824,9 @@ private String getSourceInfo() {
824824
if (attributes != null) {
825825
HttpServletRequest request = attributes.getRequest();
826826
String remoteAddr = request.getRemoteAddr();
827-
String remoteHost = request.getRemoteHost();
828827

829828
if (remoteAddr != null) {
830-
return " from " + remoteAddr +
831-
(remoteHost != null && !remoteHost.equals(remoteAddr)
832-
? " (" + remoteHost + ")"
833-
: "");
829+
return " from " + remoteAddr;
834830
}
835831
}
836832
} catch (Exception e) {

0 commit comments

Comments
 (0)