diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/auth/authlibinjector/AuthlibInjectorServer.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/auth/authlibinjector/AuthlibInjectorServer.java index f5102cbe53..d547a73879 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/auth/authlibinjector/AuthlibInjectorServer.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/auth/authlibinjector/AuthlibInjectorServer.java @@ -60,6 +60,7 @@ public static AuthlibInjectorServer locateServer(String url) throws IOException try { url = addHttpsIfMissing(url); HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection(); + conn.setRequestProperty("Accept-Language", Locale.getDefault().toLanguageTag()); String ali = conn.getHeaderField("x-authlib-injector-api-location"); if (ali != null) { @@ -68,6 +69,7 @@ public static AuthlibInjectorServer locateServer(String url) throws IOException conn.disconnect(); url = absoluteAli.toString(); conn = (HttpURLConnection) absoluteAli.openConnection(); + conn.setRequestProperty("Accept-Language", Locale.getDefault().toLanguageTag()); } } diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/NetworkUtils.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/NetworkUtils.java index afd352dbe4..706dde7734 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/NetworkUtils.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/NetworkUtils.java @@ -90,7 +90,7 @@ public static URLConnection createConnection(URL url) throws IOException { connection.setUseCaches(false); connection.setConnectTimeout(TIME_OUT); connection.setReadTimeout(TIME_OUT); - connection.setRequestProperty("Accept-Language", Locale.getDefault().toString()); + connection.setRequestProperty("Accept-Language", Locale.getDefault().toLanguageTag()); return connection; }