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

Fixed bug where BlobBaseClient.DownloadStreamingAsync() won't correct… #22306

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/storage/Azure.Storage.Blobs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Added optimization to unwrap encryption key once for DownloadTo and OpenRead when Client Side Encryption is enabled.
- Added support for RequestConditions parameter validation. If a request condition is set for an API that doesn't support it, and ArguementException will be thrown.
- This feature can be disabled with the environment variable "AZURE_STORAGE_DISABLE_REQUEST_CONDITIONS_VALIDATION" or the App Context switch "Azure.Storage.DisableRequestConditionsValidation".
- Fixed bug where BlobBaseClient.DownloadStreamingAsync() won't correctly parse the LeaseStatus header.

## 12.9.1 (2021-06-23)
- Added optimization to unwrap encryption key once for DownloadTo and OpenRead when Client Side Encryption is enabled.
Expand Down
1 change: 1 addition & 0 deletions sdk/storage/Azure.Storage.Blobs/src/BlobExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ internal static BlobDownloadStreamingResult ToBlobDownloadStreamingResult(this R
CopySource = response.Headers.CopySource == null ? null : new Uri(response.Headers.CopySource),
CopyStatus = response.Headers.CopyStatus.GetValueOrDefault(),
LeaseDuration = response.Headers.LeaseDuration ?? LeaseDurationType.Infinite,
LeaseStatus = response.Headers.LeaseStatus ?? LeaseStatus.Unlocked,
LeaseState = response.Headers.LeaseState.GetValueOrDefault(),
AcceptRanges = response.Headers.AcceptRanges,
BlobCommittedBlockCount = response.Headers.BlobCommittedBlockCount.GetValueOrDefault(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ public async Task DownloadAsync_Streaming()
var actual = new MemoryStream();
await response.Value.Content.CopyToAsync(actual);
TestHelper.AssertSequenceEqual(data, actual.ToArray());

Assert.AreEqual(LeaseStatus.Unlocked, response.Value.Details.LeaseStatus);
Assert.AreEqual(LeaseState.Available, response.Value.Details.LeaseState);
Assert.AreEqual(LeaseDurationType.Infinite, response.Value.Details.LeaseDuration);
}

[RecordedTest]
Expand Down