协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
CORS【开发与工程】Configure Cross-Origin Resource Sharing correctly to avoid security issues and debugging pain.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Access-Control-Allow-Origin: * incompatible with credentials—must specify exact originAccess-Control-Allow-Credentials: true required for cookies/auth headerscredentials: 'include'; XHR: withCredentials = true* doesn't match subdomains—*.example.com is invalid, not a pattern* with credentials—specify origin dynamically from requestAccess-Control-Allow-Headers: * works in most browsers but not all—list explicitly for compatibilityAccess-Control-Expose-Headers: * same issue—list headers you need to exposeexample.com matches evilexample.com—anchor the patternnull origin: sandboxed iframes, file:// URLs—usually reject, never allow as trustedVary: Origin when response depends on origin—even if you allow only oneVary: Access-Control-Request-Headers, Access-Control-Request-Method for preflight caching correctnessAccess-Control-Expose-HeadersX-Request-ID, X-RateLimit-*, etc. need explicit exposure—common oversightAccess-Control-Max-Age: 86400 caches preflight for 24h—reduces OPTIONS traffic significantlymode: 'no-cors' succeeds but response is empty—usually not what you wantAccess-Control-Allow-Origin: "*", "https://example.com"—must be single value, not listAccess-Control-Allow-Private-Network: true for localhost access from public web