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

Add option to pass file SHA-1 hash for upload integrity #502

Merged
merged 2 commits into from
Jan 4, 2018

Conversation

mattwiller
Copy link

Added a sha1 attribute to FileUploadParams to enable sending the
expected hash of the file for verification that the file was not
corrupted in transit.

Fixes #328

Added a sha1 attribute to FileUploadParams to enable sending the
expected hash of the file for verification that the file was not
corrupted in transit.

Fixes #328
@boxcla
Copy link

boxcla commented Dec 21, 2017

Verified that @mattwiller has signed the CLA. Thanks for the pull request!

@@ -493,6 +493,10 @@ public void canUpload(String name, long fileSize) {
fieldJSON.add("content_modified_at", BoxDateFormat.format(uploadParams.getModified()));
}

if (uploadParams.getSHA1() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to check that string is not empty
uploadParams.getSHA1() != null && !uploadParams.getSHA1().isEmpty()

Copy link
Contributor

@iamharish iamharish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only have a minor feedback. Feel free to merge it or change it

@carycheng carycheng merged commit 42d4272 into master Jan 4, 2018
@mattwiller mattwiller deleted the file_upload_sha1 branch December 15, 2018 00:45
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

Successfully merging this pull request may close these issues.

4 participants