mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-23 18:55:22 +01:00
#3342: Fix sanitized address being not IP but hostname after InetSocketAddress#getHostName()
This commit is contained in:
parent
2a716bbc7f
commit
c8e876bfe2
@ -1,5 +1,6 @@
|
||||
package net.md_5.bungee.util;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.net.Inet6Address;
|
||||
import java.net.InetSocketAddress;
|
||||
import lombok.AccessLevel;
|
||||
@ -11,7 +12,8 @@ public class AddressUtil
|
||||
|
||||
public static String sanitizeAddress(InetSocketAddress addr)
|
||||
{
|
||||
String string = addr.getHostString();
|
||||
Preconditions.checkArgument( !addr.isUnresolved(), "Unresolved address" );
|
||||
String string = addr.getAddress().getHostAddress();
|
||||
|
||||
// Remove IPv6 scope if present
|
||||
if ( addr.getAddress() instanceof Inet6Address )
|
||||
|
Loading…
Reference in New Issue
Block a user