{
  "id": "go/http-request-body-too-large",
  "signature": "http: request body too large",
  "signature_zh": "http：请求体过大",
  "regex": "http:\\ request\\ body\\ too\\ large",
  "domain": "go",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The incoming HTTP request body exceeds the server's maximum allowed size, often due to missing MaxBytesReader or server configuration.",
  "root_cause_type": "generic",
  "root_cause_zh": "传入的HTTP请求体超过服务器允许的最大大小，通常是由于缺少MaxBytesReader或服务器配置所致。",
  "versions": [
    {
      "version": "1.19",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "ReadBufferSize is not related to body size limits and will not prevent the error.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Simply increasing the limit may allow denial-of-service attacks.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "r.Body = http.MaxBytesReader(w, r.Body, 10<<20) // 10 MB limit",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "if r.ContentLength > maxSize {\n    http.Error(w, \"Request body too large\", http.StatusRequestEntityTooLarge)\n    return\n}",
      "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.9,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-01-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}