Skip to content

Commit

Permalink
Fix Azure Blob Storage uploads. Fixes loic-sharma#86
Browse files Browse the repository at this point in the history
  • Loading branch information
loic-sharma committed Sep 16, 2018
1 parent 0e9c58f commit a9a3297
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/BaGet.Azure/BlobPackageStorageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public async Task SavePackageStreamAsync(PackageArchiveReader package, Stream pa

using (var nuspecStream = package.GetNuspec())
{
packageStream.Seek(0, SeekOrigin.Begin);

await UploadBlobAsync(GetPackageBlob(identity), packageStream, PackageContentType);
await UploadBlobAsync(GetNuspecBlob(identity), nuspecStream, TextContentType);

Expand Down Expand Up @@ -92,11 +94,9 @@ private CloudBlockBlob GetReadmeBlob(PackageIdentity package)

private async Task UploadBlobAsync(CloudBlockBlob blob, Stream content, string contentType)
{
await blob.UploadFromStreamAsync(content);

blob.Properties.ContentType = contentType;

await blob.SetPropertiesAsync();
await blob.UploadFromStreamAsync(content);
}

private async Task<Stream> DownloadBlobAsync(CloudBlockBlob blob)
Expand Down

0 comments on commit a9a3297

Please sign in to comment.