BigPizzaV3/CodexPlusPlus · error · anyhow::Error

DreamSkin 响应超过大小限制

Error message

DreamSkin 响应超过大小限制

What it means

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.

Source

Thrown at crates/codex-plus-core/src/dream_skin_community.rs:416

        .with_context(|| format!("请求失败:{url}"))?;
    if !response.status().is_success() {
        bail!("DreamSkin 服务返回 HTTP {}", response.status());
    }
    let content_type = response
        .headers()
        .get(reqwest::header::CONTENT_TYPE)
        .and_then(|value| value.to_str().ok())
        .and_then(|value| value.split(';').next())
        .map(str::trim)
        .unwrap_or_default();
    if content_type != expected_content_type {
        bail!("DreamSkin 服务返回了不支持的内容类型:{content_type}");
    }
    if response
        .content_length()
        .is_some_and(|length| length == 0 || length > limit as u64)
    {
        bail!("DreamSkin 响应超过大小限制");
    }
    let mut bytes = Vec::new();
    let mut stream = response.bytes_stream();
    while let Some(chunk) = stream.next().await {
        let chunk = chunk?;
        if bytes.len().saturating_add(chunk.len()) > limit {
            bail!("DreamSkin 响应超过大小限制");
        }
        bytes.extend_from_slice(&chunk);
    }
    if bytes.is_empty() {
        bail!("DreamSkin 服务返回空响应");
    }
    Ok(bytes)
}

#[cfg(test)]
mod tests {

View on GitHub (pinned to f2074595a2)

Solutions

  1. Verify the requested resource is the expected catalog/package size
  2. Retry in case of a transient wrong response
  3. Do not raise the limit; treat oversized payloads as untrusted
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/dream_skin_community.rs:416 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/e180d3ef2d8deac9. Report an issue: GitHub.