3 Answers
- Newest
- Most votes
- Most comments
1
Hi.
If your API Gateway works with postman, I believe that the back end it's OK. Congrats!
So first you can try to enable the CORS in Amazon S3 [1]. Secondly, you should enable the CORS in your API Gateway. When you do this, automatically a OPTIONS methods it's been enabled.
After this configurations, you can try again and see if you have a 200 OK in the OPTIONS method, The CORES are well configured.
Hope this works for you.
Best Regards!
HE
[1] https://aws.amazon.com/es/premiumsupport/knowledge-center/s3-configure-cors/
answered 2 years ago
0
API Gateway does not rebuild automatically after changing CORS policy, i deployed each change and made it work eventually
answered 2 years ago
0
I did additionally enable CORS in s3
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"POST",
"HEAD"
],
"AllowedOrigins": [
"http://mystaticwebsite-1.amazonaws.com"
],
"ExposeHeaders": [
"Access-Control-Allow-Origin"
]
}
]
- CORS IN API GATAWAY IS ENABLED
- OPTIONS request returns 200 and no body,
- all tests locally work in the platform
- If i remove headers from second arguement in fetch method, i get the same error, but after over 6 seconds instead of 100ms (usually this is how long my lambda function need to run)
answered 2 years ago
Relevant content
- asked 8 months ago
- asked 6 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 months ago