{
  "id": "python/starlette-cors-middleware",
  "signature": "ValueError: CORS preflight request failed",
  "signature_zh": "值错误：CORS 预检请求失败",
  "regex": "ValueError:\\ CORS\\ preflight\\ request\\ failed",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Starlette 的 CORSMiddleware 配置不正确，例如 allow_origins 未包含请求来源。",
  "root_cause_type": "generic",
  "root_cause_zh": "Starlette 的 CORSMiddleware 配置不正确，例如 allow_origins 未包含请求来源。",
  "versions": [
    {
      "version": "3.x",
      "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": "预检请求会失败因为未允许 OPTIONS。",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "app.add_middleware(CORSMiddleware, allow_origins=['http://localhost:3000'], allow_methods=['*'], allow_headers=['*'])",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "allow_origin_regex='https?://.*'",
      "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-10-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}