Hi,
I am trying to retrieve a Contact List download from the AWS S3 bucket using the fetch API or Axios. Both return a CORS error when I try to fetch the file via the secure download URL returned by the DownloadAPI.
eg/
https://prod-apse2-dialer.s3.ap-southeast-2.amazonaws.com/contact-lists/exports/d09cbea4-1289-4c28-ae7f-3ad55a33baf5-ACC_CR_2.csv?response-content-disposition=attachment%3Bfilename%3D"d09cbea4-1289-4c28-ae7f-3ad55a33baf5-ACC_CR_2.csv"&X-Amz-Security-Token=I...........D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230226T193211Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86400&X-Amz-Credential=ASIA3EQYLGB7U5R3FDMD%2F20230226%2Fap-southeast-2%2Fs3%2Faws4_request&X-Amz-Signature=11027cce7b8c8efadd86a71387d662be703017b7d1d8a491d
Whilst this URL works fine in a browser I can't use it programmatically without triggering a CORS request. Because the application in development is running on localhost it fails CORS with AWS.
Access to XMLHttpRequest at 'https://prod-apse2-dialer.s3.ap-southeast-2.amazonaws.com/contact-lists/exports/........' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource
Can anyone help me? How do we test this?
FYI - adding 'mode: "no-cors"' to the fetch doesn't help because then the response is not available in javascript.
Cheers
Brad