{
  "id": "go/http-response-body-leak",
  "signature": "error: http: response body too large",
  "signature_zh": "错误：HTTP 响应体过大",
  "regex": "error:\\ http:\\ response\\ body\\ too\\ large",
  "domain": "go",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "HTTP 响应体超过预设的最大限制，导致读取失败。",
  "root_cause_type": "generic",
  "root_cause_zh": "HTTP 响应体超过预设的最大限制，导致读取失败。",
  "versions": [
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "会导致数据不完整或程序崩溃。",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "如果恶意响应过大，会消耗大量内存。",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "body, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20))",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "if resp.ContentLength > 1<<20 { log.Println(\"响应过大\") }",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-11-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}