Документация CLI
Проверка CORS через cors

Конструктор команды cors

CORS-доктор: воспроизводит обмен, который сделал бы браузер — preflight, реальный запрос и два дифференциальных зонда, — говорит, что именно браузер заблокирует, и печатает конфиг, который это чинит.

Установка модуля

$ conflux install cors
v0.1.0

Примеры

Типичные варианты запуска: скопируйте как есть или возьмите за основу в конструкторе ниже.

$ 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

Генератор команд

Заполните форму и получите готовую команду conflux cors — в неё попадут только опции, отличающиеся от значений по умолчанию.

Запрос

Эндпоинт, origin, который отправил бы браузер, и сам запрос со страницы.

url

Endpoint to probe

--origin

Origin the browser would send — scheme, host and port, no trailing slash

--method, -X
--body

Request body; @path reads from a file

--header, -H

Headers the browser would send — each non-safelisted one triggers a preflight

Режим

Режим credentials и ваша сессия Conflux.

--credentials

Check in credentials mode (fetch credentials: 'include')

--auth

Attach your Conflux access token as Authorization: Bearer

Транспорт

Таймаут, TLS и протокол для зондов.

--timeout

Per-probe timeout

--insecure

Skip TLS certificate verification

--http1

Force HTTP/1.1

Вывод

Сниппет фикса, форматы отчёта и то, что делает код возврата ненулевым.

--fix-for

Config snippet to print; auto detects the stack from the Server header

--fail-on

What makes the exit code 1

--json

Machine-readable output instead of the terminal report

--report

Also write a self-contained HTML report to this path

--plain

Plain uncoloured output

Готовая команда
$ conflux cors <url>

--origin обязателен — это origin, который отправил бы браузер, без завершающего слэша.