CLI hujjatlari
cors bilan CORS tekshiruvi

cors buyruq konstruktori

CORS shifokori: brauzer bajaradigan almashinuvni takrorlaydi — preflight, haqiqiy so'rov va ikkita qiyosiy zond — brauzer nimani bloklashini aniq aytadi va uni tuzatadigan konfiguratsiyani chiqaradi.

Modulni o'rnatish

$ conflux install cors
v0.1.0

Misollar

Odatiy ishga tushirish variantlari: shundayligicha nusxalang yoki quyidagi konstruktor uchun asos sifatida oling.

$ 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

Buyruq generatori

Formani to'ldiring va tayyor conflux cors buyrug'ini oling — unga faqat standart qiymatlardan farq qiluvchi opsiyalar kiradi.

So'rov

Endpoint, brauzer yuboradigan origin va sahifa bajaradigan so'rov.

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

Rejim

Credentials rejimi va Conflux seansingiz.

--credentials

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

--auth

Attach your Conflux access token as Authorization: Bearer

Transport

Zondlar uchun taymaut, TLS va protokol parametrlari.

--timeout

Per-probe timeout

--insecure

Skip TLS certificate verification

--http1

Force HTTP/1.1

Chiqish

Tuzatish sniplari, hisobot formatlari va qaytish kodini nolga teng bo'lmasligini belgilash.

--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

Tayyor buyruq
$ conflux cors <url>

--origin majburiy — brauzer yuboradigan origin, oxirida sleshsiz.