{
  "id": "go/http-header-value-invalid",
  "signature": "net/http: invalid header field value for \"X-Custom-Header\"",
  "signature_zh": "net/http: 头部字段\"X-Custom-Header\"的值无效",
  "regex": "net/http:\\ invalid\\ header\\ field\\ value\\ for\\ \"X\\-Custom\\-Header\"",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Header values contain characters not allowed by HTTP spec (e.g., newlines, control chars), causing WriteHeader to fail.",
  "root_cause_type": "generic",
  "root_cause_zh": "头部值包含HTTP规范不允许的字符（如换行、控制字符），导致WriteHeader失败。",
  "versions": [
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Escaping may change semantics; proper sanitization needed",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "May break client expectations if header is required",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use httpguts.ValidHeaderFieldValue to validate before setting",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Sanitize input by stripping invalid characters: strings.Map(func(r rune) rune { if r < 32 || r > 126 { return -1 }; return r }, val)",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}