How to use CORS Header Builder and Explainer
- Enter one allowed HTTP(S) origin, or * for a non-credentialed response. Choose credentials, allowed methods and non-safelisted request-header names.
- Supply the request origin, preflight method and header names you want to compare. Enter header names rather than their values.
- Build the headers and read each comparison row. The result compares entered settings; it does not send the request.
- Copy the header list or download the Nginx, Apache and Express drafts. Adapt them to the intended route, handle the real OPTIONS response and test the request and response in your application.
Example: CORS Header Builder and Explainer
Compare a credentialed POST from https://client.example that requests the content-type header.
Options
- Allowed origin
- One HTTP(S) origin, or * for non-credentialed sharing.
- Share a response to a credentialed request
- Adds Access-Control-Allow-Credentials: true to the draft. Use an explicit allowed origin; the wildcard origin is refused for credentialed sharing.
- Allowed methods
- Explicit uppercase methods, separated by commas.
- Allowed non-safelisted request headers
- Explicit names, separated by commas; blank for none.
- Supplied request origin
- The initial value is https://client.example.
- Supplied preflight method
- The initial value is POST.
- Supplied non-safelisted header names
- Supply the preflight header names, not their values. This model does not infer whether a real request needs preflight.
Supported inputs and limits
- Local teaching model; no live request, server configuration change, origin authorization decision or security certification.
- One explicit HTTP(S) origin or non-credentialed wildcard.
- Credentialed wildcard origins are refused.
- Other browser/server restrictions can still block a request.
- At most 30 explicit methods and header names;
More details
Fetch-forbidden CONNECT, TRACE and TRACK are refused.
Supply non-safelisted preflight header names explicitly: the tool does not infer them from values.
Configuration snippets are escaped generated text.
Review credentials, origins and preflight behavior in your application before applying them; no server is changed.
Where your input is processed
This tool does not upload your inputs. See the limits for anything saved on your device.
CORS governs browser access to a response
These headers are not authentication or a network firewall. A permitted origin is a rule for browser response sharing, not evidence that a requester is trustworthy. Use an exact origin when modelling credentialed access; a wildcard origin cannot represent that credentialed case. Apply any policy only in the server context where it belongs.
Sources
A supplied preflight is not a captured request
The model compares the supplied origin, method and non-safelisted header names. It does not decide whether the real request needs preflight, contact a server or inspect deployed middleware. The downloaded snippets set response headers; they do not implement a complete route or OPTIONS handler. Test the actual request and response after adapting a draft.
Questions about CORS Header Builder and Explainer
Does CORS authenticate a visitor?
No. It controls whether a browser exposes a cross-origin response. Authentication and authorization are separate server responsibilities.
Why is a wildcard refused with credentials?
Credentialed sharing requires an explicit origin. A wildcard Access-Control-Allow-Origin cannot authorize that browser response.
Does a passing simulation prove my server works?
No. It compares entered settings only. Your real response, browser state, redirects and network behavior remain untested.