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
ContentMD5 for s3.getSignedUrl #675
Comments
@thattommyhall I see here that you are creating the signed url without the You will have to create a signed url with the For example: // NOTE: This is a private API and may change in the future
var md5 = AWS.util.crypto.md5('hello' ,'base64');
var params = {
Bucket: 'bucket',
Key: 'key',
ContentMD5: md5,
ContentType: 'text/plain'
}
var url = s3.getSignedUrl('putObject', params);
// Using jQuery in the browser
$.ajax({
url: url,
method: 'PUT',
data: 'hello',
contentType: 'text/plain',
headers: {
'Content-MD5': md5
},
success: callback
}); The above code works fine when PUTting to a pre-signed URL with Content-MD5 specified. Hopes this helps clarify things! |
I was commenting and uncommenting those lines, sorry I committed the one with it commented out. I have updated the project, with the example directly PUTing using the https://github.com/thattommyhall/aws-sdk-bug/blob/master/example.js Both Content-MD5 are commented out now, but I have tried all 4 options of using them, the only one that works is not setting it in both the sign and PUT |
@thattommyhall I missed the fact that you're using the SigV4. I was able to reproduce the issue and I've pushed up a fix which should land in master soon. Thanks very much for reporting this! |
@thattommyhall Can you also explain what your use case is that is causing this issue? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
I can't get a signed request to work with ContentMD5.
If I do
It works, but
will not work if I have ContentMD5.
I have tried adding Content-MD5 headers to the put (as the content type was not set until I added headers).
I made a project at https://github.com/thattommyhall/aws-sdk-bug, you should be able to run
(but I have also tried it with
curl --upload-file
)The text was updated successfully, but these errors were encountered: