Closed cloudnloud closed 3 years ago
Hi, you need to allow CORS access for
http://s3.us-east-1.amazonaws.com/cnl-test-poc
from http://cnl-test-poc.s3-website-us-east-1.amazonaws.com
Error From Browser Console
Access to fetch at 'http://s3.us-east-1.amazonaws.com/cnl-test-poc?list-type=2&delimiter=/&prefix=&max-keys=50' from origin 'http://cnl-test-poc.s3-website-us-east-1.amazonaws.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
OR
Just use following URL to access your bucket browser http://s3.us-east-1.amazonaws.com/cnl-test-poc/index.html
I hope this will help
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"http://cnl-test-poc.s3-website-us-east-1.amazonaws.com/",
"http://s3.us-east-1.amazonaws.com/cnl-test-poc"
],
"ExposeHeaders": [
"x-amz-server-side-encryption",
"x-amz-request-id",
"x-amz-id-2"
],
"MaxAgeSeconds": 3000
}
]
i added the above in CORS.still i am getting the failed to fetch error
however the below url is working.
http://s3.us-east-1.amazonaws.com/cnl-test-poc/index.html
is there anyway without index.html can we get it working ?
may you can try to remove trailing /
from http://cnl-test-poc.s3-website-us-east-1.amazonaws.com/ in AllowedOrigins
Yes.It is workng now.Thanks for your help
Glad to hear that.
I have downloaded index.html and placed in my bucket.
My Bucket policy
CORS POLICY
my s3 bucket url is
http://cnl-test-poc.s3-website-us-east-1.amazonaws.com/
if i access ,i am getting failed to fetch error.Help on this