{
  "id": "python/flask-request-cookie-parse-error",
  "signature": "werkzeug.exceptions.BadRequest: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.",
  "signature_zh": "Werkzeug 异常：400 错误请求：浏览器（或代理）发送了服务器无法理解的请求。",
  "regex": "werkzeug\\.exceptions\\.BadRequest:\\ 400\\ Bad\\ Request:\\ The\\ browser\\ \\(or\\ proxy\\)\\ sent\\ a\\ request\\ that\\ this\\ server\\ could\\ not\\ understand\\.",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Malformed cookie header in the request, causing parsing failure.",
  "root_cause_type": "generic",
  "root_cause_zh": "请求中的 Cookie 头格式错误，导致解析失败。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Raises BadRequest; you need to handle it.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The request is invalid; you should return a 400.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.8,
      "how": "Use request.cookies.get('key') which returns None on parsing error? Actually, it raises; wrap in try/except BadRequest.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.7,
      "how": "Validate the cookie header manually before accessing",
      "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.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2026-06-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}