Inspector CORS Preflight

Cuéntanos sobre una llamada fetch(). Te mostraremos si el navegador disparará un preflight CORS, cómo es la petición OPTIONS en la red y, una vez pegues las cabeceras de respuesta, si realmente permitirían pasar la petición. Cada error de configuración viene con una corrección de una línea. 100% del lado del cliente, sin subir nada.

Petición

Cabeceras de la petición

One per row, in the order the browser would send them. Click + Add header to add a row.

Cuerpo de la petición (opcional)

Veredicto del preflight

¿Está en la lista segura CORS?

Rellena la petición arriba para ver si el navegador hará un preflight.

Por qué dispara un preflight
  • Sin disparadores de preflight (todavía).
Petición de preflight OPTIONS

Comprobación de la respuesta

Pega las cabeceras de respuesta Access-Control-* que devolvió realmente el servidor (una por línea, en formato Nombre: valor). O pega un bloque de respuesta completo — ignoraremos la línea de estado y el cuerpo.

Quick reference

Simple request
A fetch the browser sends without a preflight. Must be GET, HEAD, or POST; may only set Accept, Accept-Language, Content-Language, Content-Type (with a restricted value), and a handful of device hints; and may not include credentials.
Preflight
An OPTIONS request the browser sends first when the real request is not CORS-safelisted. The server must approve it before the browser sends the real request.
Access-Control-Allow-Origin
Either the exact requesting origin, or * for public reads. The wildcard is forbidden when credentials are on.
Access-Control-Allow-Methods
Comma-separated methods the server is willing to handle at this URL. The wildcard is not allowed here.
Access-Control-Allow-Headers
Comma-separated request header names the server is willing to read. The wildcard works for non-credentialed requests.
Access-Control-Allow-Credentials
Set to true only when the server wants cookies / HTTP auth on cross-origin requests.
Vary: Origin
Advisory. If Allow-Origin is dynamic (not *), shared caches need Vary: Origin to avoid serving one origin's response to another.