Skip to content

Commit

Permalink
Merge pull request Azure#48 from jofriedm-msft/dev
Browse files Browse the repository at this point in the history
Fixed transactional MD5 check
  • Loading branch information
jofriedm-msft authored May 3, 2017
2 parents 05ac043 + bc57978 commit 9585f95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BreakingChanges.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FILE
* In CloudFileShareProperties, setShareQuota() no longer asserts in bounds. This check has been moved to create() and uploadProperties() in CloudFileShare.

BLOB/FILE
* Fixed a bug which allowed setting content MD5 to true when calling openWriteExisting() on a page blob or file.
* Fixed a bug which prevented setting content MD5 to true when calling openWriteExisting() on a page blob or file.

Changes in 5.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,13 @@ public Integer preProcessResponse(CloudBlob blob, CloudBlobClient client, Operat
// Need to store the Content MD5 in case we fail part way through.
// We would still need to verify the entire range.
String contentMD5 = this.getConnection().getHeaderField(Constants.HeaderConstants.CONTENT_MD5);

if (!options.getDisableContentMD5Validation() && options.getUseTransactionalContentMD5()
&& Utility.isNullOrEmpty(contentMD5)) {
throw new StorageException(StorageErrorCodeStrings.MISSING_MD5_HEADER, SR.MISSING_MD5,
Constants.HeaderConstants.HTTP_UNUSED_306, null, null);
}

this.setContentMD5(contentMD5);
this.setLockedETag(blob.properties.getEtag());
this.setArePropertiesPopulated(true);
Expand Down

0 comments on commit 9585f95

Please sign in to comment.