From 5ccf22c5c42c4f07bc995e5f6e7314e3bfc2e8aa Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Wed, 6 Mar 2019 17:45:38 -0500 Subject: [PATCH] Relax (i.e. remove all checks) on the hostname. While validating this is a good idea, it causes too many issues in practice. We will still clean the server address but no validation is performed on the address. --- .../velocitypowered/proxy/connection/ConnectionType.java | 2 +- .../connection/forge/legacy/LegacyForgeConnectionType.java | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/ConnectionType.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/ConnectionType.java index 81cb4e504..a69768946 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/ConnectionType.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/ConnectionType.java @@ -42,6 +42,6 @@ public interface ConnectionType { * @return true if valid. */ default boolean checkServerAddressIsValid(String address) { - return !address.contains("\0"); + return true; } } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/forge/legacy/LegacyForgeConnectionType.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/forge/legacy/LegacyForgeConnectionType.java index 0b0ded3d3..544680bc4 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/forge/legacy/LegacyForgeConnectionType.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/forge/legacy/LegacyForgeConnectionType.java @@ -31,10 +31,4 @@ public class LegacyForgeConnectionType extends ConnectionTypeImpl { return original; } - - @Override - public boolean checkServerAddressIsValid(String address) { - return super.checkServerAddressIsValid( - address.replaceAll(LegacyForgeConstants.HANDSHAKE_HOSTNAME_TOKEN, "")); - } }