Tool Hub

CORS 模擬器

瀏覽器請求 + 伺服器原則 → 允許/阻止 + preflight 必要

Browser request

Authorization

Server policy

GETPOST
AuthorizationContent-Type

Reasons

Preflight required (GET method or non-simple headers)

Preflight (OPTIONS) response headers

Access-Control-Allow-Originhttps://example.com
Access-Control-Allow-MethodsGET, POST
Access-Control-Allow-HeadersAuthorization, Content-Type

使用方法

  1. Fill in the browser request section: choose an HTTP method, enter the requesting origin, set a Content-Type, and add any custom headers。
  2. Fill in the server policy section: set Access-Control-Allow-Origin, allowed methods, allowed headers, and the credentials flag。
  3. Read the result — the tool tells you whether the request is allowed or blocked, and whether a preflight OPTIONS request is required。
  4. Adjust any field to explore how changing the policy or request affects the CORS outcome。

範例

  • Request from https://app.example.com with method POST and server policy Access-Control-Allow-Origin: * shows allowed, no preflight needed for simple requests。
  • Adding a custom header X-Api-Key to the request while the server Allow-Headers list is empty triggers a preflight requirement and a blocked result。

生產環境使用前請驗證輸出。無擔保 — 參見 條款.