-
Notifications
You must be signed in to change notification settings - Fork 633
fix(lib-storage): add validation for partCount and contentLength for multipart upload #7363
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
Conversation
… multipart upload
lib/lib-storage/src/Upload.ts
Outdated
} | ||
|
||
private __validateUploadPart(dataPart: RawDataPart): void { | ||
const actualPartSize = byteLength(dataPart.data) || undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what falsy values does byteLength return? What if it's zero?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can return zero for empty parts, may be for scenarios like empty file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if byteLength
can return undefined, then the expression should be byteLength(dataPart.data);
zero byte length should not be converted to undefined
.
bf89a19
to
ef5a56e
Compare
Issue
Internal JS-6196
Description
Testing
Locally
yarn test
andyarn test:e2e
are successfulChecklist
*.integ.spec.ts
).@public
tag and enable doc generation on the package?By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.