3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-09-29 06:30:16 +02:00

Load forced hosts as lowercase too, see #464

Dieser Commit ist enthalten in:
Andrew Steinborn 2021-04-18 08:22:36 -04:00
Ursprung ff54622663
Commit ca52f8989e

Datei anzeigen

@ -43,6 +43,7 @@ import java.nio.file.StandardCopyOption;
import java.security.SecureRandom; import java.security.SecureRandom;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.Random; import java.util.Random;
@ -600,9 +601,11 @@ public class VelocityConfiguration implements ProxyConfig {
Map<String, List<String>> forcedHosts = new HashMap<>(); Map<String, List<String>> forcedHosts = new HashMap<>();
for (UnmodifiableConfig.Entry entry : config.entrySet()) { for (UnmodifiableConfig.Entry entry : config.entrySet()) {
if (entry.getValue() instanceof String) { if (entry.getValue() instanceof String) {
forcedHosts.put(entry.getKey(), ImmutableList.of(entry.getValue())); forcedHosts.put(entry.getKey().toLowerCase(Locale.ROOT),
ImmutableList.of(entry.getValue()));
} else if (entry.getValue() instanceof List) { } else if (entry.getValue() instanceof List) {
forcedHosts.put(entry.getKey(), ImmutableList.copyOf((List<String>) entry.getValue())); forcedHosts.put(entry.getKey().toLowerCase(Locale.ROOT),
ImmutableList.copyOf((List<String>) entry.getValue()));
} else { } else {
throw new IllegalStateException( throw new IllegalStateException(
"Invalid value of type " + entry.getValue().getClass() + " in forced hosts!"); "Invalid value of type " + entry.getValue().getClass() + " in forced hosts!");