Describe the bug
When utilizing Complex Objects (as described here) to automatically upload files to S3, the upload will fail when utilizing amplify mock due to a CORS error. Based on the access errors I am getting, it looks like the client is trying to upload to the S3 bucket in AWS instead of utilizing the mock version on localhost. If I switch the implementation to manually uploading the file using Storage, the correct behaviour happens and the file is uploaded to the mock bucket hosted locally.
When not running amplify mock, the complex objects upload functionality works correctly with the cloud resources.
To Reproduce
Implement a public file upload using complex objects as described in the docs. Run amplify mock. Attempt to upload a file.
Expected behavior
Files automatically uploaded utilizing the complex objects API should use the local S3 mock server instead of the cloud environment bucket when running amplify mock.
Describe the bug When utilizing Complex Objects (as described here) to automatically upload files to S3, the upload will fail when utilizing amplify mock due to a CORS error. Based on the access errors I am getting, it looks like the client is trying to upload to the S3 bucket in AWS instead of utilizing the mock version on localhost. If I switch the implementation to manually uploading the file using Storage, the correct behaviour happens and the file is uploaded to the mock bucket hosted locally.
When not running amplify mock, the complex objects upload functionality works correctly with the cloud resources.
To Reproduce Implement a public file upload using complex objects as described in the docs. Run amplify mock. Attempt to upload a file.
Expected behavior Files automatically uploaded utilizing the complex objects API should use the local S3 mock server instead of the cloud environment bucket when running amplify mock.
Original Issue: https://github.com/aws-amplify/amplify-js/issues/7625