{
  "id": "python/fastapi-cors-preflight-credentials",
  "signature": "Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.",
  "signature_zh": "预检响应未通过访问控制：当请求的credentials模式为'include'时，'Access-Control-Allow-Origin'响应头不能为通配符'*'。",
  "regex": "Response\\ to\\ preflight\\ request\\ doesn't\\ pass\\ access\\ control\\ check:\\ The\\ value\\ of\\ the\\ 'Access\\-Control\\-Allow\\-Origin'\\ header\\ in\\ the\\ response\\ must\\ not\\ be\\ the\\ wildcard\\ '\\*'\\ when\\ the\\ request's\\ credentials\\ mode\\ is\\ 'include'\\.",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "CORSMiddleware configured with allow_origins=['*'] and allow_credentials=True simultaneously.",
  "root_cause_type": "generic",
  "root_cause_zh": "CORSMiddleware同时配置了allow_origins=['*']和allow_credentials=True。",
  "versions": [
    {
      "version": "0.100.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "0.110.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Breaks cookie/auth flows that require credentials.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Browsers still enforce the CORS check client-side.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "app.add_middleware(CORSMiddleware, allow_origins=['https://app.example.com'], allow_credentials=True)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.92,
      "how": "app.add_middleware(CORSMiddleware, allow_origin_regex=r'https://.*\\.example\\.com', allow_credentials=True)",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-09-21",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}