{
  "id": "python/flask-cors-no-access-control-origin",
  "signature": "Access to XMLHttpRequest at 'http://api.local/users' from origin 'http://app.local' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.",
  "signature_zh": "从源 'http://app.local' 访问 'http://api.local/users' 的 XMLHttpRequest 已被 CORS 策略阻止：请求的资源上不存在 'Access-Control-Allow-Origin' 头。",
  "regex": "Access\\ to\\ XMLHttpRequest\\ at\\ 'http://api\\.local/users'\\ from\\ origin\\ 'http://app\\.local'\\ has\\ been\\ blocked\\ by\\ CORS\\ policy:\\ No\\ 'Access\\-Control\\-Allow\\-Origin'\\ header\\ is\\ present\\ on\\ the\\ requested\\ resource\\.",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "Flask-CORS was not initialized, or the origin was not in the allowed list, so the browser blocked the cross-origin response.",
  "root_cause_type": "generic",
  "root_cause_zh": "未初始化 Flask-CORS，或源不在允许列表中，导致浏览器阻止了跨域响应。",
  "versions": [
    {
      "version": "4.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Preflight OPTIONS requests still fail, so POST/PUT never reach the server.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Browsers reject wildcard origins when credentials are included.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "from flask_cors import CORS\nCORS(app, origins=['http://app.local'], supports_credentials=True)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "@app.route('/users', methods=['GET','OPTIONS'])\ndef users(): ...",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-07",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}