amazon-web-servicescorsaws-api-gateway

Preflight request is succeeds, but GET request fails with CORS error status code 200 OK


For context I've set up an API gateway and integrated a lambda.

The preflight request is returning 204 alongside Access-Control-* headers. However, the GET request has a CORS error but a status code of 200 OK

I saw a similar stack overflow question but no help.

What am I doing wrong?

Here are some screenshots:

Screenshot of the network tab, preflight request passed, subsequent request fails with CORS error

Screenshot of the general and response headers within the network tab of the preflight request

Screenshot of the general and response headers within the network tab of the subsequent GET request


Solution

  • Fixed. Turns out I had to return the same Access-Control-* from the lambda as well.