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
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.
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
Rejim
Credentials rejimi va Conflux seansingiz.
Check in credentials mode (fetch credentials: 'include')
Attach your Conflux access token as Authorization: Bearer
Transport
Zondlar uchun taymaut, TLS va protokol parametrlari.
Per-probe timeout
Skip TLS certificate verification
Force HTTP/1.1
Chiqish
Tuzatish sniplari, hisobot formatlari va qaytish kodini nolga teng bo'lmasligini belgilash.
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 majburiy — brauzer yuboradigan origin, oxirida sleshsiz.