diff options
| author | 2026-03-26 09:23:07 +0800 | |
|---|---|---|
| committer | 2026-03-26 09:23:07 +0800 | |
| commit | f8b4bcb3bdc8f11323103081ef8c05b06159d684 (patch) | |
| tree | e86c8d46e73262c67c1755aaf4202cbcd1f8f844 /src-tauri/src/core/modpack.rs | |
| parent | 1812ca8974aee347b61bd415c1e2b63a205137dd (diff) | |
| parent | 94b0d8e208363c802c12b56d8bdbef574dd1fb91 (diff) | |
| download | DropOut-f8b4bcb3bdc8f11323103081ef8c05b06159d684.tar.gz DropOut-f8b4bcb3bdc8f11323103081ef8c05b06159d684.zip | |
Merge branch 'main' of https://github.com/HydroRoll-Team/DropOut
Diffstat (limited to 'src-tauri/src/core/modpack.rs')
| -rw-r--r-- | src-tauri/src/core/modpack.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src-tauri/src/core/modpack.rs b/src-tauri/src/core/modpack.rs index 5ac9493..a580000 100644 --- a/src-tauri/src/core/modpack.rs +++ b/src-tauri/src/core/modpack.rs @@ -294,7 +294,7 @@ fn parse_multimc(archive: &mut Archive) -> Result<ParsedModpack, String> { // ── CurseForge API resolution ───────────────────────────────────────────── -const CURSEFORGE_API_KEY: &str = env!("CURSEFORGE_API_KEY"); +const CURSEFORGE_API_KEY: Option<&str> = option_env!("CURSEFORGE_API_KEY"); async fn resolve_curseforge_files(files: &[ModpackFile]) -> Result<Vec<ModpackFile>, String> { let file_ids: Vec<u64> = files @@ -368,9 +368,12 @@ async fn cf_post( endpoint: &str, body: &serde_json::Value, ) -> Result<serde_json::Value, String> { + let api_key = CURSEFORGE_API_KEY + .ok_or("CurseForge modpack support requires CURSEFORGE_API_KEY set at build time")?; + let resp = client .post(format!("https://api.curseforge.com{endpoint}")) - .header("x-api-key", CURSEFORGE_API_KEY) + .header("x-api-key", api_key) .json(body) .send() .await |