From c3994a677be4fb3065db2151c71c24f53faa7308 Mon Sep 17 00:00:00 2001 From: RK_01 <50594595+RaphiMC@users.noreply.github.com> Date: Fri, 7 Jun 2024 00:54:33 +0200 Subject: [PATCH] Override forward-hostname setting if ViaProxy wildcard domain handling is enabled (#4720) --- .../viaproxy/GeyserViaProxyConfiguration.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bootstrap/viaproxy/src/main/java/org/geysermc/geyser/platform/viaproxy/GeyserViaProxyConfiguration.java b/bootstrap/viaproxy/src/main/java/org/geysermc/geyser/platform/viaproxy/GeyserViaProxyConfiguration.java index bf9d6816c..1b82e9f67 100644 --- a/bootstrap/viaproxy/src/main/java/org/geysermc/geyser/platform/viaproxy/GeyserViaProxyConfiguration.java +++ b/bootstrap/viaproxy/src/main/java/org/geysermc/geyser/platform/viaproxy/GeyserViaProxyConfiguration.java @@ -27,6 +27,7 @@ package org.geysermc.geyser.platform.viaproxy; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import net.raphimc.vialegacy.api.LegacyProtocolVersion; import net.raphimc.viaproxy.ViaProxy; +import net.raphimc.viaproxy.protocoltranslator.viaproxy.ViaProxyConfig; import org.geysermc.geyser.configuration.GeyserJacksonConfiguration; import java.io.File; @@ -50,4 +51,16 @@ public class GeyserViaProxyConfiguration extends GeyserJacksonConfiguration { return interval; } + @Override + public RemoteConfiguration getRemote() { + return new RemoteConfiguration() { + + @Override + public boolean isForwardHost() { + return super.isForwardHost() || !ViaProxy.getConfig().getWildcardDomainHandling().equals(ViaProxyConfig.WildcardDomainHandling.NONE); + } + + }; + } + }