/install cors-tester
cors-tester
Test, debug, and generate CORS configurations from the command line.
Quick Start
# Test CORS headers on a URL
python3 scripts/cors_tester.py test https://api.example.com/data --origin https://myapp.com
# Test preflight (OPTIONS) request
python3 scripts/cors_tester.py preflight https://api.example.com/data --origin https://myapp.com --method POST --header "Content-Type"
# Generate CORS config for a framework
python3 scripts/cors_tester.py config --framework nginx --origins "https://myapp.com,https://staging.myapp.com" --methods "GET,POST,PUT,DELETE"
# Audit CORS security
python3 scripts/cors_tester.py audit https://api.example.com/data
Commands
test
Send a request with an Origin header and inspect the CORS response headers.
python3 scripts/cors_tester.py test \x3Curl> --origin \x3Corigin> [--method GET]
Options:
--origin \x3Curl>— Origin to test (required)--method \x3Cmethod>— HTTP method (default: GET)--verbose— Show all response headers
Output shows:
Access-Control-Allow-Origin— Whether the origin is allowedAccess-Control-Allow-Credentials— Whether credentials are supportedAccess-Control-Expose-Headers— Which headers are exposed
preflight
Send an OPTIONS preflight request to test if a cross-origin request would be allowed.
python3 scripts/cors_tester.py preflight \x3Curl> --origin \x3Corigin> [--method POST] [--header Content-Type]
Options:
--origin \x3Curl>— Origin to test (required)--method \x3Cmethod>— Method to request (default: POST)--header \x3Cname>— Custom header to request (repeatable)
Output shows:
Access-Control-Allow-Methods— Allowed methodsAccess-Control-Allow-Headers— Allowed headersAccess-Control-Max-Age— Preflight cache duration
audit
Check a URL for common CORS misconfigurations and security issues.
python3 scripts/cors_tester.py audit \x3Curl>
Checks for:
- Wildcard origin (
*) with credentials - Origin reflection (server echoes any origin back)
- Missing
Vary: Originheader - Overly permissive allowed methods
- Missing preflight cache (
Access-Control-Max-Age)
config
Generate CORS configuration snippets for common frameworks.
python3 scripts/cors_tester.py config --framework \x3Cname> --origins \x3Corigins> [--methods \x3Cmethods>] [--headers \x3Cheaders>] [--credentials]
Options:
--framework \x3Cname>— Target:nginx,apache,express,flask,fastapi,rails--origins \x3Ccsv>— Comma-separated allowed origins--methods \x3Ccsv>— Comma-separated methods (default:GET,POST,OPTIONS)--headers \x3Ccsv>— Comma-separated allowed headers (default:Content-Type,Authorization)--credentials— Allow credentials--max-age \x3Cseconds>— Preflight cache (default: 86400)
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install cors-tester - 安装完成后,直接呼叫该 Skill 的名称或使用
/cors-tester触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
CORS Tester 是什么?
Test and debug CORS (Cross-Origin Resource Sharing) configurations on live URLs. Use when checking if a server returns correct CORS headers, debugging CORS e... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 213 次。
如何安装 CORS Tester?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install cors-tester」即可一键安装,无需额外配置。
CORS Tester 是免费的吗?
是的,CORS Tester 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
CORS Tester 支持哪些平台?
CORS Tester 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 CORS Tester?
由 John Wang(@johnnywang2001)开发并维护,当前版本 v1.0.0。