{
  "id": "python/fastapi-cors-origin-not-allowed",
  "signature": "fastapi.exceptions.HTTPException: 500 Internal Server Error: CORS error: Origin http://localhost:3000 is not allowed.",
  "signature_zh": "FastAPI HTTP 异常：500 内部服务器错误，CORS 错误：不允许的来源 http://localhost:3000。",
  "regex": "fastapi\\.exceptions\\.HTTPException:\\ 500\\ Internal\\ Server\\ Error:\\ CORS\\ error:\\ Origin\\ http://localhost:3000\\ is\\ not\\ allowed\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "跨域请求来源未在 CORS 配置中允许。",
  "root_cause_type": "generic",
  "root_cause_zh": "跨域请求来源未在 CORS 配置中允许。",
  "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.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "当 allow_credentials=True 时，不能使用通配符。",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "from fastapi.middleware.cors import CORSMiddleware\\napp.add_middleware(CORSMiddleware, allow_origins=['http://localhost:3000'], allow_methods=['*'], allow_headers=['*'])",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "allow_origin_regex='https?://localhost:3000'",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-08",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}