-
Notifications
You must be signed in to change notification settings - Fork 2k
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
companion: add required 'content-length' header if not present #2387
Conversation
@goto-bus-stop @arturi any input on this? Would be great to get this usable. |
This may not be the best solution but it got things working for me. |
This indeed is an issue, thank you for the PR! However, in the case of formData, the Is this an update you can make? This is only needed for the formData case. |
In my organization we are currently experiencing this same issue, I can create a PR to cover the formData case. Do you guys think using stream-length similar to this PR is worth it? my plan is to create a promise using stream-length then |
I don't currently have a setup to easily test the |
@johnnyperkins I don't have the right setup to test the |
@johnnyperkins is it confirmed that this issue also exists for the case where How are using instantiating the S3 uploader on your end? By default, the S3 plugin uses formData for |
@ifedapoolarewaju uppy.use(AwsS3, {
limit: 5,
timeout: 30 * 1000, // 30s
companionUrl: 'http://localhost:3020/',
getUploadParameters: Uploader.getUploadParameters
}) static async getUploadParameters (file) {
const md5 = file.isRemote
? undefined // TODO have companion attach an md5 to it's response so we can do file.md5
: await fileMD5(file.data, { base64: true })
const signedurl = await fetchSignedUrl(file, md5)
return Promise.resolve({
method: 'PUT',
url: signedurl,
headers: {
'Content-Type': file.type,
'Content-MD5': md5
}
})
} |
@johnnyperkins @mejiaej Closing this in favour of #2466. Thank you for the work both 🙏 |
This fixes an issue of uploads to s3 from companion failing due to no 'content-length' header being sent.