Cors command builder
A CORS doctor: replays the exchange a browser would make β preflight, real request, and two differential probes β then tells you exactly what the browser will block and prints the config that fixes it.
Install this module
$ conflux install cors
Examples
Common invocations to copy as-is, or use as a starting point for the builder below.
$ conflux cors https://api.example.com/orders --origin https://app.example.com
$ conflux cors https://api.example.com/orders --origin https://app.example.com \$ -X POST -H "Content-Type: application/json" --credentials
$ conflux cors https://api.example.com/orders --origin https://app.example.com \$ --fix-for nginx
$ conflux cors https://api.example.com/health --origin https://app.example.com \$ --json --fail-on warning
$ conflux cors explain CORS-008
Command generator
Fill in the form and get a ready-to-run conflux cors command β only options that differ from the defaults are included.
Request
The endpoint, the origin the browser would send, and the request the page would make.
Endpoint to probe
Origin the browser would send β scheme, host and port, no trailing slash
Request body; @path reads from a file
Headers the browser would send β each non-safelisted one triggers a preflight
Mode
Credentials mode and your Conflux session.
Check in credentials mode (fetch credentials: 'include')
Attach your Conflux access token as Authorization: Bearer
Transport
Timeout, TLS and protocol options for the probes.
Per-probe timeout
Skip TLS certificate verification
Force HTTP/1.1
Output
Fix snippet, report formats and what makes the exit code non-zero.
Config snippet to print; auto detects the stack from the Server header
What makes the exit code 1
Machine-readable output instead of the terminal report
Also write a self-contained HTML report to this path
Plain uncoloured output
$ conflux cors <url>
--origin is required β the origin the browser would send, with no trailing slash.