From e92e50bb78f8e17eacea19b908e34c854eed1e37 Mon Sep 17 00:00:00 2001 From: jhqwqmc <2110242767@qq.com> Date: Fri, 18 Apr 2025 06:45:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(core):=20=E4=B8=BA=20CustomApiHost=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BA=AB=E4=BB=BD=E9=AA=8C=E8=AF=81=E5=AF=86?= =?UTF-8?q?=E9=92=A5=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../craftengine/core/pack/host/impl/CustomApiHost.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/src/main/java/net/momirealms/craftengine/core/pack/host/impl/CustomApiHost.java b/core/src/main/java/net/momirealms/craftengine/core/pack/host/impl/CustomApiHost.java index 57aac027e..7189970d3 100644 --- a/core/src/main/java/net/momirealms/craftengine/core/pack/host/impl/CustomApiHost.java +++ b/core/src/main/java/net/momirealms/craftengine/core/pack/host/impl/CustomApiHost.java @@ -9,9 +9,7 @@ import net.momirealms.craftengine.core.plugin.CraftEngine; import net.momirealms.craftengine.core.util.GsonHelper; import java.io.FileNotFoundException; -import java.net.MalformedURLException; import java.net.URI; -import java.net.URL; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; @@ -118,7 +116,7 @@ public class CustomApiHost implements ResourcePackHost { @Override public ResourcePackHost create(Map arguments) { String apiUrl = (String) arguments.get("api-url"); - String authKey = (String) arguments.get("auth-key"); + String authKey = (String) arguments.getOrDefault("auth-key", ""); if (apiUrl == null || apiUrl.isEmpty()) { throw new IllegalArgumentException("'api-url' cannot be empty for custom api host"); }