Override forward-hostname setting if ViaProxy wildcard domain handling is enabled (#4720)

This commit is contained in:
RK_01 2024-06-07 00:54:33 +02:00 committed by GitHub
parent 688b642520
commit c3994a677b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,6 +27,7 @@ package org.geysermc.geyser.platform.viaproxy;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import net.raphimc.vialegacy.api.LegacyProtocolVersion; import net.raphimc.vialegacy.api.LegacyProtocolVersion;
import net.raphimc.viaproxy.ViaProxy; import net.raphimc.viaproxy.ViaProxy;
import net.raphimc.viaproxy.protocoltranslator.viaproxy.ViaProxyConfig;
import org.geysermc.geyser.configuration.GeyserJacksonConfiguration; import org.geysermc.geyser.configuration.GeyserJacksonConfiguration;
import java.io.File; import java.io.File;
@ -50,4 +51,16 @@ public class GeyserViaProxyConfiguration extends GeyserJacksonConfiguration {
return interval; return interval;
} }
@Override
public RemoteConfiguration getRemote() {
return new RemoteConfiguration() {
@Override
public boolean isForwardHost() {
return super.isForwardHost() || !ViaProxy.getConfig().getWildcardDomainHandling().equals(ViaProxyConfig.WildcardDomainHandling.NONE);
}
};
}
} }