{"record":{"id":"e180d3ef2d8deac9","repo":"BigPizzaV3/CodexPlusPlus","slug":"dreamskin-e180d3","errorCode":null,"errorMessage":"DreamSkin 响应超过大小限制","messagePattern":"DreamSkin 响应超过大小限制","errorType":"http","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_community.rs","lineNumber":416,"sourceCode":"        .with_context(|| format!(\"请求失败：{url}\"))?;\n    if !response.status().is_success() {\n        bail!(\"DreamSkin 服务返回 HTTP {}\", response.status());\n    }\n    let content_type = response\n        .headers()\n        .get(reqwest::header::CONTENT_TYPE)\n        .and_then(|value| value.to_str().ok())\n        .and_then(|value| value.split(';').next())\n        .map(str::trim)\n        .unwrap_or_default();\n    if content_type != expected_content_type {\n        bail!(\"DreamSkin 服务返回了不支持的内容类型：{content_type}\");\n    }\n    if response\n        .content_length()\n        .is_some_and(|length| length == 0 || length > limit as u64)\n    {\n        bail!(\"DreamSkin 响应超过大小限制\");\n    }\n    let mut bytes = Vec::new();\n    let mut stream = response.bytes_stream();\n    while let Some(chunk) = stream.next().await {\n        let chunk = chunk?;\n        if bytes.len().saturating_add(chunk.len()) > limit {\n            bail!(\"DreamSkin 响应超过大小限制\");\n        }\n        bytes.extend_from_slice(&chunk);\n    }\n    if bytes.is_empty() {\n        bail!(\"DreamSkin 服务返回空响应\");\n    }\n    Ok(bytes)\n}\n\n#[cfg(test)]\nmod tests {","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_community.rs#L398-L434","documentation":"Size guard in download_limited: the DreamSkin response exceeded the configured byte limit — either declared via Content-Length or accumulated while streaming chunks. Enforced to bound memory usage and reject oversized/malicious payloads.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_community.rs:416 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the requested resource is the expected catalog/package size","Retry in case of a transient wrong response","Do not raise the limit; treat oversized payloads as untrusted"],"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"}