Reputation: 2665
I can't Enable CORS on my API Gateway instance, this is how it looks:
I've tried a bunch of things like checking the DEFAULT 4XX
and DEFAULT 5XX
and manually inputting the Access-Control-Allow-Methods as suggested in some posts.
If I hover over the error I get: Invalid Response status code specified
.
I'm able to GET using my browser but POST can only be done from Postman. My ReactJS website won't post either, throwing:
Access to XMLHttpRequest at <ENDPOINT> from origin <S3-REACT-BUCKET> has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I've read that I have my React app should send the CORS headers (haven't got to that) but I can't even Enable CORS in the API Gateway!
Upvotes: 7
Views: 3903
Reputation: 53
You can unselect the methods except options and then change the "Access-Control-Allow-Origin" and then click on the enable cors button .there wont be any changes even after you enabled it just redeploy your apis it might work.this worked for me
Upvotes: 0