BigPizzaV3/CodexPlusPlus · error

DreamSkin 响应超过大小限制

Error message

DreamSkin 响应超过大小限制

What it means

download_limited enforces a size limit on the streamed response body: it first checks the Content-Length header, then accumulates chunks and bails as soon as the total would exceed the caller-provided limit. This protects against oversized or unbounded responses (memory exhaustion) from the DreamSkin service.

Solutions

  1. Check the actual response size; if the package legitimately exceeds the limit, it must be republished under 32 MiB.
  2. Enable compression checks/server-side minification and re-download; verify with curl -I that Content-Length is sane.
  3. Retry — if a proxy is inflating responses, bypass it or fix its configuration.
  4. Report an unbounded-streaming endpoint to the service operator as a potential abuse vector.

Example fix

// before
let bytes = download_limited(&client, &pkg_url, "application/zip", UNTRUSTED_HUGE_LIMIT).await?;
// after
let bytes = download_limited(&client, &pkg_url, "application/zip", PACKAGE_BYTES_LIMIT).await?; // republish the package if it truly exceeds this
Defensive patterns

Strategy: validation

Validate before calling

// Rust
let resp = client.head(&url).send().await?;
let too_big = resp.content_length().is_some_and(|n| n == 0 || n > PACKAGE_BYTES_LIMIT);

Try / catch

// Rust
Err(e) if e.to_string().contains("大小限制") => {
    eprintln!("响应超过 32 MiB 限制:请确认主题包未被替换或服务未被滥用");
}

Prevention

When it happens

Trigger: fetch_community_catalog or install_community_theme receiving a body whose declared Content-Length is 0 or exceeds the limit, or whose streamed chunks accumulate past the limit (declared length may be absent/lying).

Common situations: Server misconfiguration returning an uncompressed or concatenated payload; a compromised/misbehaving mirror streaming endless data; downloading a package that legitimately grew beyond the 32 MiB cap; proxy injecting extra content.

Understand the failure class

Background: "File too large" / "file size exceeds limit" errors: why libraries cap file sizes and how to fix them — this error's family across 46 libraries.

Related errors


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

Appendix: source

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

        .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 b1ed92e5e4)