{
  "schemaVersion": "1.0",
  "item": {
    "slug": "cors",
    "name": "CORS",
    "source": "tencent",
    "type": "skill",
    "category": "安全合规",
    "sourceUrl": "https://clawhub.ai/ivangdavila/cors",
    "canonicalUrl": "https://clawhub.ai/ivangdavila/cors",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/cors",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=cors",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/cors"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/cors",
    "agentPageUrl": "https://openagent3.xyz/skills/cors/agent",
    "manifestUrl": "https://openagent3.xyz/skills/cors/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/cors/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Preflight Triggers",
        "body": "Any header except: Accept, Accept-Language, Content-Language, Content-Type (with restrictions)\nContent-Type other than: application/x-www-form-urlencoded, multipart/form-data, text/plain\nMethods: PUT, DELETE, PATCH, or any custom method\nReadableStream in request body\nEvent listeners on XMLHttpRequest.upload\nOne trigger = preflight; simple requests skip OPTIONS entirely"
      },
      {
        "title": "Credentials Mode",
        "body": "Access-Control-Allow-Origin: * incompatible with credentials—must specify exact origin\nAccess-Control-Allow-Credentials: true required for cookies/auth headers\nFetch: credentials: 'include'; XHR: withCredentials = true\nWithout credentials mode, cookies not sent even to same origin for cross-origin requests"
      },
      {
        "title": "Wildcard Limitations",
        "body": "* doesn't match subdomains—*.example.com is invalid, not a pattern\nCan't use * with credentials—specify origin dynamically from request\nAccess-Control-Allow-Headers: * works in most browsers but not all—list explicitly for compatibility\nAccess-Control-Expose-Headers: * same issue—list headers you need to expose"
      },
      {
        "title": "Origin Validation",
        "body": "Check Origin header against allowlist—don't reflect blindly (security risk)\nRegex matching pitfall: example.com matches evilexample.com—anchor the pattern\nnull origin: sandboxed iframes, file:// URLs—usually reject, never allow as trusted\nMissing Origin header: same-origin or non-browser client—handle explicitly"
      },
      {
        "title": "Vary Header (Critical)",
        "body": "Always include Vary: Origin when response depends on origin—even if you allow only one\nWithout Vary: CDN/proxy caches response for one origin, serves to others—breaks CORS\nAdd Vary: Access-Control-Request-Headers, Access-Control-Request-Method for preflight caching correctness"
      },
      {
        "title": "Exposed Headers",
        "body": "By default, JS can only read: Cache-Control, Content-Language, Content-Type, Expires, Last-Modified, Pragma\nCustom headers invisible to JS unless listed in Access-Control-Expose-Headers\nX-Request-ID, X-RateLimit-*, etc. need explicit exposure—common oversight"
      },
      {
        "title": "Preflight Caching",
        "body": "Access-Control-Max-Age: 86400 caches preflight for 24h—reduces OPTIONS traffic significantly\nChrome caps at 2 hours; Firefox at 24 hours—values above are silently reduced\nCached per origin + URL + request characteristics—not globally\nSet to 0 or omit during development—caching hides config changes"
      },
      {
        "title": "Debugging",
        "body": "CORS error in browser = request reached server and came back—check server logs\nPreflight failure: server must return 2xx with CORS headers on OPTIONS—404/500 = failure\nOpaque response in fetch: mode: 'no-cors' succeeds but response is empty—usually not what you want\nNetwork tab shows CORS errors; Console shows which header is missing"
      },
      {
        "title": "Common Server Mistakes",
        "body": "Only setting CORS headers on main handler, not OPTIONS—preflight fails\nSetting headers after error response—CORS headers missing on 4xx/5xx breaks error handling\nProxy stripping headers—verify headers reach client, not just that server sets them\nAccess-Control-Allow-Origin: \"*\", \"https://example.com\"—must be single value, not list"
      },
      {
        "title": "Security",
        "body": "Don't reflect Origin header blindly—validate against allowlist first\nPrivate Network Access: Chrome requires Access-Control-Allow-Private-Network: true for localhost access from public web\nCORS doesn't prevent request from being sent—just blocks response reading; server still processes it\nSensitive endpoints: don't rely on CORS alone; use authentication + CSRF tokens"
      }
    ],
    "body": "Preflight Triggers\nAny header except: Accept, Accept-Language, Content-Language, Content-Type (with restrictions)\nContent-Type other than: application/x-www-form-urlencoded, multipart/form-data, text/plain\nMethods: PUT, DELETE, PATCH, or any custom method\nReadableStream in request body\nEvent listeners on XMLHttpRequest.upload\nOne trigger = preflight; simple requests skip OPTIONS entirely\nCredentials Mode\nAccess-Control-Allow-Origin: * incompatible with credentials—must specify exact origin\nAccess-Control-Allow-Credentials: true required for cookies/auth headers\nFetch: credentials: 'include'; XHR: withCredentials = true\nWithout credentials mode, cookies not sent even to same origin for cross-origin requests\nWildcard Limitations\n* doesn't match subdomains—*.example.com is invalid, not a pattern\nCan't use * with credentials—specify origin dynamically from request\nAccess-Control-Allow-Headers: * works in most browsers but not all—list explicitly for compatibility\nAccess-Control-Expose-Headers: * same issue—list headers you need to expose\nOrigin Validation\nCheck Origin header against allowlist—don't reflect blindly (security risk)\nRegex matching pitfall: example.com matches evilexample.com—anchor the pattern\nnull origin: sandboxed iframes, file:// URLs—usually reject, never allow as trusted\nMissing Origin header: same-origin or non-browser client—handle explicitly\nVary Header (Critical)\nAlways include Vary: Origin when response depends on origin—even if you allow only one\nWithout Vary: CDN/proxy caches response for one origin, serves to others—breaks CORS\nAdd Vary: Access-Control-Request-Headers, Access-Control-Request-Method for preflight caching correctness\nExposed Headers\nBy default, JS can only read: Cache-Control, Content-Language, Content-Type, Expires, Last-Modified, Pragma\nCustom headers invisible to JS unless listed in Access-Control-Expose-Headers\nX-Request-ID, X-RateLimit-*, etc. need explicit exposure—common oversight\nPreflight Caching\nAccess-Control-Max-Age: 86400 caches preflight for 24h—reduces OPTIONS traffic significantly\nChrome caps at 2 hours; Firefox at 24 hours—values above are silently reduced\nCached per origin + URL + request characteristics—not globally\nSet to 0 or omit during development—caching hides config changes\nDebugging\nCORS error in browser = request reached server and came back—check server logs\nPreflight failure: server must return 2xx with CORS headers on OPTIONS—404/500 = failure\nOpaque response in fetch: mode: 'no-cors' succeeds but response is empty—usually not what you want\nNetwork tab shows CORS errors; Console shows which header is missing\nCommon Server Mistakes\nOnly setting CORS headers on main handler, not OPTIONS—preflight fails\nSetting headers after error response—CORS headers missing on 4xx/5xx breaks error handling\nProxy stripping headers—verify headers reach client, not just that server sets them\nAccess-Control-Allow-Origin: \"*\", \"https://example.com\"—must be single value, not list\nSecurity\nDon't reflect Origin header blindly—validate against allowlist first\nPrivate Network Access: Chrome requires Access-Control-Allow-Private-Network: true for localhost access from public web\nCORS doesn't prevent request from being sent—just blocks response reading; server still processes it\nSensitive endpoints: don't rely on CORS alone; use authentication + CSRF tokens"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/ivangdavila/cors",
    "publisherUrl": "https://clawhub.ai/ivangdavila/cors",
    "owner": "ivangdavila",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/cors",
    "downloadUrl": "https://openagent3.xyz/downloads/cors",
    "agentUrl": "https://openagent3.xyz/skills/cors/agent",
    "manifestUrl": "https://openagent3.xyz/skills/cors/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/cors/agent.md"
  }
}