Cluster 7B · CORS Preflight Linter + Web Crypto HMAC-SHA256 Debugger

CORS Preflight Policy Generator & Webhook HMAC-SHA256 Debugger

Lint dangerous CORS misconfigurations (wildcard + credentials, origin reflection, missing Vary: Origin, browser Max-Age caps) across Cloudflare Workers, Nginx, Express, FastAPI, Next.js & Go — and verify GitHub, Stripe, Creem, Slack & Shopify HMAC-SHA256 signatures via pure browser crypto.subtle.

Zero Telemetry · Strict CSP (connect-src 'none')

CORS Policy & Preflight Controls

Access-Control-Allow-Methods
Simulate Browser Preflight Request (OPTIONS)
CORS Security & Fetch Spec Linter
100 / 100
PASS

Pass: 3 · Warnings: 0 · Errors: 0

CORS-002: Strict origin allowlist (2 origins) PASS
https://app.example.com, https://studio.example.com
CORS-004: Vary: Origin cache safety enabled PASS
Prevents CDN/proxy cache poisoning across distinct allowed origins.
CORS-005: Access-Control-Max-Age (7200s) within Chromium 7200s cap PASS
Avoids unnecessary OPTIONS preflight round-trips while honoring cross-browser cache ceilings.
Simulated Preflight Response
# Simulated Browser Preflight: OPTIONS /api/v1/resource
# Request Origin: https://app.example.com | Method: POST | Headers: Authorization, Content-Type
# Browser Verdict: ALLOWED (HTTP 204 No Content)

HTTP/1.1 204 No Content
Access-Control-Allow-Origin: https://app.example.com
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
Access-Control-Allow-Headers: Authorization, Content-Type, X-Requested-With, Idempotency-Key
Access-Control-Expose-Headers: X-Request-Id, X-RateLimit-Remaining
Access-Control-Allow-Credentials: true
Access-Control-Max-Age: 7200
Vary: Origin

Copy-Paste Runtime Configs (6 Stacks)

Cloudflare Workers (worker-cors.ts)
const ALLOWED_ORIGINS = new Set(["https://app.example.com","https://studio.example.com"]);

function buildCorsHeaders(request: Request): Record<string, string> {
  const origin = request.headers.get("Origin") || "";
  const allowOrigin = ALLOWED_ORIGINS.has(origin) ? origin : "";
  const headers: Record<string, string> = {
    "Access-Control-Allow-Methods": "GET, POST, PUT, PATCH, DELETE, OPTIONS",
    "Access-Control-Allow-Headers": "Authorization, Content-Type, X-Requested-With, Idempotency-Key",
    "Access-Control-Expose-Headers": "X-Request-Id, X-RateLimit-Remaining",
    "Access-Control-Allow-Credentials": "true",
    "Access-Control-Max-Age": "7200"
  };
  if (allowOrigin) headers["Access-Control-Allow-Origin"] = allowOrigin;
  headers["Vary"] = "Origin";
  return headers;
}

export default {
  async fetch(request: Request): Promise<Response> {
    const cors = buildCorsHeaders(request);
    if (request.method === "OPTIONS") {
      return new Response(null, { status: 204, headers: cors });
    }
    return new Response(JSON.stringify({ ok: true }), {
      headers: { "Content-Type": "application/json", ...cors }
    });
  }
};
Live API & Edge Audit Zero-Upload SpecDiff

Harden your live domain headers, OpenAPI schemas & AEO discovery

Test your deployed domain's security headers, HSTS, CSP & DMARC live on ReadyCheck, diff OpenAPI contracts & OWASP API Top 10 risks in SpecDiff, or deploy all 9 production configs in minutes with the $49 ReadyCheck Fix Pack.

6 CORS Runtime & Webhook HMAC Stack Guides

Production middleware snippets, proxy header pitfall fixes, and constant-time HMAC signature verifiers.

Related tools: OpenAPI OWASP API Top 10 & MCP Scorer → · SBOM & Sigstore Rekor Validator → · HTTP Security Headers & Strict CSP → · A2A & MCP Discovery →

Frequently Asked Questions

Why does Access-Control-Allow-Origin: * fail when credentials are enabled?

The Fetch standard prohibits combining wildcard '*' with Access-Control-Allow-Credentials: true to block cross-origin credential theft. You must echo only exact allowlisted origins alongside Vary: Origin.

How does the Webhook HMAC-SHA256 verifier compute signatures safely?

All HMAC computations execute purely inside your browser via Web Crypto (crypto.subtle.importKey + crypto.subtle.sign) over exact UTF-8 bytes — handling empty payloads and multi-byte Unicode without ever transmitting secrets.

Which webhook providers are built in?

GitHub (X-Hub-Signature-256), Stripe (Stripe-Signature t=,v1=), Creem (creem-signature), Slack (X-Slack-Signature v0=), and Shopify (X-Shopify-Hmac-Sha256 Base64).