Ad
ListObjects Request From Salesforce To AWS S3 Results In "refused To Connect" Error
I'm developing a Salesforce component that makes a request to AWS S3 using the AWS JavaScript SDK.
When making the request below, I receive the console error Refused to connect to https://mybucket.s3.amazonaws.com/list-type=2&prefix=00Q5e000001Vx7iEAC
s3.listObjectsV2(
{Bucket:'mybucket', Prefix: component.get('v.recordId')},
function (err, data) {
if (err) {
console.log(err);
} else {
console.log(data);
}
}
);
I am confused why this is happening since I am able to make requests using s3.getSignedUrl()
without any errors.
What do I need to do to allow this request from Salesforce to AWS?
Ad
Answer
As @jellycsc said, I realized that the requests were different.
Turns out that I just needed to add https://mybucket.s3.amazonaws.com
to my CSP trusted sites in Salesforce.
Ad
source: stackoverflow.com
Related Questions
- → AWS SDK with Lumen
- → Using AWS Certificate with a parked domain for a shopify store
- → laravel or AWS don't detect my https
- → S3 putObject callback not returning expected objects
- → Amazon S3 image hosting with Shopify
- → Redirection to https not working using AWS Elastic Beanstalk
- → Shopify app showing request blocked by an extension
- → AWS Iam commands, Working correct in terminal and not working in Laravel/PHP AWS SDK
- → Violates the following Content Security Policy directive: *** in Shopify
- → AWS S3 cannot delete objects in bucket via PHP SDK
- → Laravel s3 multiple buckets
- → AWS IoT private.pem.key doesn't exist
- → Supervise queue in laravel 5.1
Ad