From 32f3f25a7cb193e2881f50fa5b6579bc6da8b131 Mon Sep 17 00:00:00 2001 From: Anten Skrabec Date: Wed, 29 Jul 2026 20:10:13 -0600 Subject: [PATCH] fix: remove hardcoded 500 MB download size limit The arbitrary MAX_DOWNLOAD_SIZE cap could block legitimate large mods. Downloads are user-initiated and disk space is the real constraint. Closes #324 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/forge/client.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/forge/client.rs b/src/forge/client.rs index 8d91f97..64701b1 100644 --- a/src/forge/client.rs +++ b/src/forge/client.rs @@ -10,8 +10,6 @@ use super::rate_limit::RateLimiter; const DEFAULT_BASE_URL: &str = "https://forge.sp-tarkov.com/api/v0"; const MAX_RETRIES: u32 = 3; -const MAX_DOWNLOAD_SIZE: u64 = 500 * 1024 * 1024; // 500 MB - #[cfg(test)] const EXTERNAL_READ_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(3); #[cfg(not(test))] @@ -373,14 +371,6 @@ impl ForgeClient { .context("download_file returned error status")?; let total_size = resp.content_length(); - if let Some(size) = total_size { - anyhow::ensure!( - size <= MAX_DOWNLOAD_SIZE, - "download too large ({:.0} MB, limit {:.0} MB)", - size as f64 / (1024.0 * 1024.0), - MAX_DOWNLOAD_SIZE as f64 / (1024.0 * 1024.0) - ); - } let mut stream = resp.bytes_stream(); let mut file = tokio::fs::File::create(dest) .await @@ -396,11 +386,6 @@ impl ForgeClient { .await .context("error writing to file")?; downloaded += bytes.len() as u64; - anyhow::ensure!( - downloaded <= MAX_DOWNLOAD_SIZE, - "download exceeded size limit ({:.0} MB)", - MAX_DOWNLOAD_SIZE as f64 / (1024.0 * 1024.0) - ); if last_log.elapsed() >= std::time::Duration::from_secs(10) { last_log = std::time::Instant::now();