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

Potential Bug: Presigned URL Works with cUrl but not react-s3-uploader #197

Open
neilchaudhuri opened this issue Dec 21, 2018 · 6 comments

Comments

@neilchaudhuri
Copy link

neilchaudhuri commented Dec 21, 2018

I have been attempting to solve this issue I posted to Stack Overflow. Long story short at this point, I have found this cURL command works:

curl --upload-file "/Users/me/Desktop/george-goretex-coat.jpg" 'https://my-bucket.s3.amazonaws.com/5c09c130be47e6d7b58aaa65/GEORGE-GORETEX-COAT-af268c79d0.jpg?Content-Type=image/jpeg&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20181221T174741Z&X-Amz-SignedHeaders=host&X-Amz-Expires=586799&X-Amz-Credential=AKIAI4HGTBPUXDEMOS5Q/20181221/us-east-1/s3/aws4_request&X-Amz-Signature=3c61743d37ffc65f186616ce8cd2875ec0e1b960088e9fd6a6c9b17e58991038'

I copied and pasted that presigned url from Chrome Developer Tools after react-s3-uploader got to work. However, react-s3-uploader returns a 403 Forbidden for that same presigned url.

Any ideas on what the difference might be?

@Timonzimm
Copy link

Could you let us know how you actually solved the problem?

@golya
Copy link

golya commented Feb 26, 2019

@neilchaudhuri could you solve this issue?

@neilchaudhuri
Copy link
Author

I didn't. I couldn't figure it out in the time I had and moved on. Sorry.

@golya
Copy link

golya commented Feb 27, 2019

I think I found the issue, I think it is a bug: this is what it sends:
{..."body":null,...}
the body is null, I try to check in the code what happens.

@golya
Copy link

golya commented Feb 27, 2019

@neilchaudhuri can you reopen this issue?

@golya
Copy link

golya commented Feb 27, 2019

@neilchaudhuri @Timonzimm this solved the problem: uploadRequestHeaders={{}}
in line 174:
xhr.setRequestHeader('x-amz-acl', 'public-read'); caused the issue, this is means you can read a public bucket, but I supposed you had private as well.

@neilchaudhuri neilchaudhuri reopened this Feb 27, 2019
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

3 participants