Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 listBuckets CORS is not available #6608

Open
kesor opened this issue Feb 18, 2018 · 28 comments
Open

S3 listBuckets CORS is not available #6608

kesor opened this issue Feb 18, 2018 · 28 comments
Assignees
Labels
documentation This is a problem with documentation. p2 This is a standard priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.

Comments

@kesor
Copy link

kesor commented Feb 18, 2018

According to SERVICES.md the S3 service is CORS enabled. And yet calling listBuckets when using aws-sdk.js in a browser, fails to work because the services is not enabled with CORS.

I'm using aws-sdk.js version

AWS.VERSION
"2.188.0"

The code running in the browser is just

AWS.config.credentials = new AWS.Credentials({ accessKeyId: "...", "secretAccessKey": "..." })
const s3 = new AWS.S3({ region: "us-east-1" })
s3.listBuckets()

Getting this result in the console

aws-sdk.min.js:47 OPTIONS https://s3.eu-central-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-central-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-west-3.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-west-3.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-west-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-west-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-west-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-west-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-central-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-central-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-west-3.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-west-3.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-central-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-central-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-west-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-west-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-west-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-west-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-central-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-central-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ca-central-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ca-central-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-west-3.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-west-3.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-south-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-south-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.us-east-2.amazonaws.com/ net::ERR_ABORTED
(index):1 Failed to load https://s3.us-east-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-west-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-west-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-west-3.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-west-3.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-south-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-south-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-west-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-west-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.us-west-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.us-west-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ca-central-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ca-central-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.us-east-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.us-east-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ca-central-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ca-central-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-south-1.amazonaws.com/ net::ERR_ABORTED
(index):1 Failed to load https://s3.ap-south-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.us-west-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.us-west-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-west-1.amazonaws.com/ net::ERR_ABORTED
(index):1 Failed to load https://s3.eu-west-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.sa-east-1.amazonaws.com/ net::ERR_ABORTED
(index):1 Failed to load https://s3.sa-east-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.us-east-2.amazonaws.com/ net::ERR_ABORTED
(index):1 Failed to load https://s3.us-east-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-southeast-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-southeast-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.us-west-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.us-west-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.us-west-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.us-west-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ca-central-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ca-central-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.us-east-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.us-east-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.us-west-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.us-west-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.eu-west-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.eu-west-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-northeast-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-northeast-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-northeast-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-northeast-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-southeast-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-southeast-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.sa-east-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.sa-east-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-southeast-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-southeast-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-south-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-south-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.us-west-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.us-west-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.sa-east-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.sa-east-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-northeast-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-northeast-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.us-west-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.us-west-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-southeast-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-southeast-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-southeast-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-southeast-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-northeast-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-northeast-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-northeast-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-northeast-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.sa-east-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.sa-east-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-southeast-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-southeast-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-northeast-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-northeast-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.us-west-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.us-west-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-southeast-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-southeast-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-northeast-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-northeast-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-southeast-2.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-southeast-2.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
aws-sdk.min.js:47 OPTIONS https://s3.ap-northeast-1.amazonaws.com/ 403 (Forbidden)
(index):1 Failed to load https://s3.ap-northeast-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
@jeskew jeskew added the service-api This issue is due to a problem in a service API, not the SDK implementation. label Feb 19, 2018
@jeskew
Copy link
Contributor

jeskew commented Feb 19, 2018

S3 allows CORS supported to be enabled and configured on a bucket by bucket basis, but as far as I know, there is no way to enable CORS for bucket-level operations (e.g., ListBuckets, CreateBucket, etc.). I'll forward this request onto the service team, but it would be more effective coming directly from a customer. You can reach out to the service team directly via their AWS Developer Forum or through a ticket with AWS support.

@RoboSparrow
Copy link

I suppose this is the case with a number of sdk Methods. It would be helpful if CORS limitations could be included in the SDK docs.

@AllanZhengYP
Copy link
Contributor

Hey @RoboSparrow, I believe this is a very valid request. Maybe we can add a note in docs that the service doesn't support cors. You can always check the CORS support by yourself here. The specific service supports CORS if it specifies cors: true

@simonbuchan
Copy link
Contributor

@AllanFly120 that file has listed s3 as supporting cors since sept. 2016.

@srchase
Copy link
Contributor

srchase commented Sep 11, 2018

@simonbuchan

See @jeskew's comment above: #6608

I'll leave this issue open to track improving the documentation, but the S3 service team would need to implement CORS support for listBuckets to work from the browser.

@simonbuchan
Copy link
Contributor

Yes, I was just replying to allans comment that you can see if CORS has support in that file, which clearly you can't in this case, hence this issue 😉

@Private-SO
Copy link

+1 for this feature request

1 similar comment
@krislavten
Copy link

+1 for this feature request

@RoboSparrow
Copy link

There might be valid reasons not to enable CORS for some operations. It would be good to have these labelled clearly in "Method Summary" section for each service class and the method section itself.

Yes, CORS limits are mentioned int the installation section. But hey, most of us read that section only once. The problem is that we usually just jump right to the method
(where it is not mentioned), and start coding..

@jagmumidi
Copy link

i am getting following error

message:"Cannot read property 'listBuckets' of undefined"
stack:"TypeError: Cannot read property 'listBuckets' of undefined\n    at S3BucketConstructE2ETest.checkS3Bucket (S3BucketConstructE2ETest.js:35:33)\n    at S3BucketConstructE2ETest.js:23:24\n    at new Promise (<anonymous>)\n    at S3BucketConstructE2ETest.runTests (S3BucketConstructE2ETest.js:22:16)\n    at Object.<anonymous> (/e2e-tests/S3BucketConstructE2ETest.js:53:7)\n    at Module._compile (internal/modules/cjs/loader.js:933:14)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)\n    at Module.load (internal/modules/cjs/loader.js:790:32)\n    at Function.Module._load (internal/modules/cjs/loader.js:703:12)\n    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)"
__proto__:Error {constructor: , name: "TypeError", message: "", …}

@Mitriol
Copy link

Mitriol commented Dec 10, 2019

Is there any chance that this functionality, though not currently supported, could be added? It's something that I at least know my project would benefit greatly from, as our target user aren't too technical and if we could simply skip the step of them having the "aws ls" in their terminal, that would be excellent.

@matwerber1
Copy link

+1, I want to create an in-browser app that provides my own custom UI for viewing / navigating information across buckets in an account.

I suppose I could proxy a request Lambda via API Gateway and have the Lambda make the call on my behalf, but would much prefer to do it natively in the front-end code (using Cognito / federated identity pools)

@cyrfer
Copy link

cyrfer commented May 11, 2020

Please add CORS support for ListBuckets.

@github-actions
Copy link

Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label May 12, 2021
@kesor
Copy link
Author

kesor commented May 12, 2021

Apparently no one at AWS deems it important enough to give this any attention in the last three years. And now there is a bot that auto-closes "old" issues that no one cares about. 👍 Great job AWS!

@ajredniwja
Copy link
Contributor

Hey @kesor, apologies that the issue was not added to auto exempt, usually the bot is actually for issues where there has been no response from the customer and is just a low hanging fruit in the repo, with that being said, looking at the comments, were you able to open any requests at the forum mentioned? If not, I can open a ticket internally.

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label May 13, 2021
@kesor
Copy link
Author

kesor commented May 18, 2021

Hey @kesor, apologies that the issue was not added to auto exempt, usually the bot is actually for issues where there has been no response from the customer and is just a low hanging fruit in the repo, with that being said, looking at the comments, were you able to open any requests at the forum mentioned? If not, I can open a ticket internally.

@ajredniwja

At the time of the issue I opened all possible tickets, created a forum post with the S3 service forum, etc... nothing happened still. Feel free to open additional tickets. It is not the tickets that resolve the issue, it is the adding of two lines to the API output of S3 service for CORS.

@ajredniwja
Copy link
Contributor

@kesor, apologies again, unfortunately it has to be enabled by the S3 team, I have reached out to the team, will get back to you as soon as I have an answer.

@johnrteg
Copy link

Probably too old, but it would be nice to list buckets without the CORS headache. The work around to manage available buckets in a json file in a created (well known) bucket will have to suffice for now.

@github-actions
Copy link

Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Dec 30, 2022
@kesor
Copy link
Author

kesor commented Dec 30, 2022

Another year, another lack of CORS in S3 APIs. It literally takes ten minutes to test and deploy such a change.

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Dec 31, 2022
@krislavten
Copy link

I was disappointed with the efficiency of AWS

@jrodimusprime
Copy link

Still waiting on this one

@kesor
Copy link
Author

kesor commented Mar 22, 2023

@NewbiZ
Copy link

NewbiZ commented Sep 8, 2023

Come on it's been 5 years now, can we please have CORS on bucket level operations?

@BRome-SmallBatchAI
Copy link

Having the same issue, it seems impossible to use this request in React.

@adamcloudboss
Copy link

Any update on this?

@RanVaknin
Copy link
Contributor

Hi All,

I'm going through older issues and came across this. After reproducing this I can see that this remains an issue and is a broader problem and not an SDK specific issue.

I cannot commit to S3 adding the CORS header to the responses from listBuckets and CreateBucket because I do not have visibility as to why these operations were excluded in the first place. Perhaps there is a good reason. If this is the expected behavior this must be clearly documented since it's clearly a recurring pain point for customers.

I have created an internal ticket (#P137549575) with the S3 team asking for some clarifications. If any of the customers on this thread have access to support via the AWS developer console I suggest you open a support case as well and reference this ticket ID.

I will transfer this issue to the JS SDK v3 repo to make it more discoverable.

Thanks,
Ran~

@RanVaknin RanVaknin self-assigned this Jun 26, 2024
@RanVaknin RanVaknin transferred this issue from aws/aws-sdk-js Jun 26, 2024
@RanVaknin RanVaknin added the p2 This is a standard priority issue label Jun 26, 2024
@RanVaknin RanVaknin transferred this issue from aws/aws-sdk-js-v3 Aug 12, 2024
@zshzbh zshzbh transferred this issue from aws/aws-sdk Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. p2 This is a standard priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests