- Newest
- Most votes
- Most comments
this is what solve the trick... partially
(i cant believe amazon dont have a wizard to this.. but: )
i have changes the policy
{
"Version": "2012-10-17",
"Id": "Policy1627561847500",
"Statement": [
{
"Sid": "Stmt1627561827637",
"Effect": "Allow",
"Principal": "",
"Action": [
"s3:GetObject",
"s3:GetObjectAcl",
"s3:GetBucketLocation",
"s3:ListBucket",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::s-cart-x/",
"arn:aws:s3:::s-cart-x"
],
"Condition": {
"StringLike": {
"aws:Referer": [
"https://shopping-cart-x.herokuapp.com/",
"http://localhost:3000/seller/NewProductScreen"
]
}
}
}
]
}
the issue now - is that the cors AllowedOrigins have to be AllowedOrigins:"*" ...
it fails with localhost:3000... or localhost:3000/myPath
so this is the cors setting that fix the localhost for me
[
{
"AllowedHeaders": [
""
],
"AllowedMethods": [
"PUT",
"POST",
"GET",
"DELETE"
],
"AllowedOrigins": [
"http://localhost:3000"
],
"ExposeHeaders": [
"x-amz-server-side-encryption",
"x-amz-request-id",
"x-amz-id-2",
"Connection",
"ETag"
]
},
{
"AllowedHeaders": [
""
],
"AllowedMethods": [
"PUT",
"POST",
"GET",
"DELETE"
],
"AllowedOrigins": [
"https://s-cart-x.herokuapp.com/"
],
"ExposeHeaders": [
"x-amz-server-side-encryption",
"x-amz-request-id",
"x-amz-id-2",
"Connection",
"ETag"
]
}
]
so by now finly s3 is working....
it was a nightmer -
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated a year ago