I am using Aws-sdk in my angular application.uploading and deleting files processes are working fine but when it comes to get file object from s3 bucket sometimes i get cors policy error . any solution to overcome this problem? this is my bucket policy?
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"PUT",
"POST",
"DELETE"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": [
"Etag"
]
}
]
As I can see that the bucket policy looks fine. Try to fix this on the client-side I mean in the angular application.
Here is a good guide,
https://medium.com/weekly-webtips/do-you-know-how-to-resolve-cors-issues-in-angular-9d818474825f
I don't recommend using '*' in the s3 configuration.