CORS issue using public S3 storage

I’m struggling with a CORS issue when trying to upload a new IFC model. I have a S3 API compliant public access with cors enabled.

Speckle Server Version 2.26.5, set S3_ENDPOINT and FF_NEXT_GEN_FILE_IMPORTER_ENABLED to true. I’ve also set all S3 properties correctly.

When uploading a new model within the frontend, the S3 clients put preflight fails with code 403 telling that,

Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Indeed, it’s missing and I like to use CORS.

Is there any possibility to configure CORS behaviour with speckle for S3 AWS client? There is an example inside AWS documentation - aws-doc-sdk-examples/javascriptv3/example_code/s3/actions/put-bucket-cors.js at 309de24d867a2b3f01d4da8018ad8173243556af · awsdocs/aws-doc-sdk-examples · GitHub.

Does anyone have experience on this?

Cheers, Bernold.

Hi Bernold,

The CORS options have to be set on the S3 compatible blob storage provider that your server is using.

Instructions for AWS S3 are here: Configuring cross-origin resource sharing (CORS) - Amazon Simple Storage Service

You will need to allow PUT action from your origin, and ensure the response header ETag is exposed.

Iain

2 Likes

Finally it was a missing allowed header configuration. After fixing, it works fine.

2 Likes