{"record":{"id":"acd1c4a51cc6b8a5","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-acd1c4","errorCode":null,"errorMessage":"下载内容超过 {} 字节限制","messagePattern":"下载内容超过 (.+?) 字节限制","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_market.rs","lineNumber":267,"sourceCode":"}\n\nasync fn download_limited(\n    client: &reqwest::Client,\n    url: &str,\n    limit: usize,\n) -> anyhow::Result<Vec<u8>> {\n    let response = client\n        .get(url)\n        .send()\n        .await\n        .with_context(|| format!(\"请求失败：{url}\"))?\n        .error_for_status()\n        .with_context(|| format!(\"服务器返回错误状态：{url}\"))?;\n    if response\n        .content_length()\n        .is_some_and(|size| size > limit as u64)\n    {\n        bail!(\"下载内容超过 {} 字节限制\", limit);\n    }\n    let mut stream = response.bytes_stream();\n    let mut bytes = Vec::new();\n    while let Some(chunk) = stream.next().await {\n        let chunk = chunk.context(\"读取下载内容失败\")?;\n        if bytes.len().saturating_add(chunk.len()) > limit {\n            bail!(\"下载内容超过 {} 字节限制\", limit);\n        }\n        bytes.extend_from_slice(&chunk);\n    }\n    if bytes.is_empty() {\n        bail!(\"下载内容为空\");\n    }\n    Ok(bytes)\n}\n\nfn cache_manifest(state_dir: &Path, manifest: &DreamSkinMarketManifest) -> anyhow::Result<()> {\n    let bytes = serde_json::to_vec_pretty(manifest)?;","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_market.rs#L249-L285","documentation":"Size-limit guard in download_limited: either the HTTP Content-Length header or the accumulated streamed bytes exceed the per-asset limit (manifest/theme/image each have their own cap). Prevents a malicious or misconfigured market server from exhausting memory or disk.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_market.rs:267 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry after the market asset is fixed/reduced","Check whether the asset URL is serving the wrong (oversized) content"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}