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 Wrong URL formed which says CORS issue #108

Open
aashishpsaini opened this issue Mar 12, 2021 · 1 comment
Open

S3 Wrong URL formed which says CORS issue #108

aashishpsaini opened this issue Mar 12, 2021 · 1 comment

Comments

@aashishpsaini
Copy link

aashishpsaini commented Mar 12, 2021

In the recent amazon updates, there are a couple of changes in the AWS S3 API which is failing the S3 image upload in the editor.
When we upload an image it throws an error saying Parsing failed with status as CORS error.
As per the docs, the correct URL format is:
https://<bucket-name>.s3.<region>.amazonaws.com

And the current URL formed is
https://<region>.amazonaws.com/<bucket-name>

I had a look at the minified JS which computes this as:
A.opts.imageUploadToS3 && (s = A.opts.imageUploadToS3.uploadURL ? A.opts.imageUploadToS3.uploadURL : "https://".concat(A.opts.imageUploadToS3.region, ".amazonaws.com/").concat(A.opts.imageUploadToS3.bucket)),

I believe this is a simple change and should be looked on a priority as things are breaking currently.

@planetaska
Copy link

planetaska commented Oct 21, 2022

For me the error is 400 bad request.

I have followed these instructions, but no luck.
https://froala.com/wysiwyg-editor/docs/sdks/ruby/file-s3-upload/

The URL can be modified this way:

# in your controller or helper
hash = FroalaEditorSDK::S3.data_hash(options)
hash[:uploadURL] = 'https://your-bucket.s3.your-region.amazonaws.com/'
return hash

But still doesn't work - still got 400 bad request.

I guess the lib and the docs are both very outdated? Please update these issues. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants