Set the correct content type for version badges in blob storage.

This is needed to display the version badges as images in external
websites like github.
This commit is contained in:
Sridhar Periyasamy 2016-03-10 10:23:52 -08:00
parent 88c1340f6d
commit 0dad10253b

View file

@ -154,9 +154,12 @@ namespace Microsoft.DotNet.Cli.Build
private static void PublishFileAzure(string blob, string file)
{
CloudBlockBlob blockBlob = BlobContainer.GetBlockBlobReference(blob);
using (var fileStream = File.OpenRead(file))
blockBlob.UploadFromFileAsync(file, FileMode.Open).Wait();
if (Path.GetExtension(blockBlob.Uri.AbsolutePath.ToLower()) == ".svg")
{
blockBlob.UploadFromStreamAsync(fileStream).Wait();
blockBlob.Properties.ContentType = "image/svg+xml";
blockBlob.SetPropertiesAsync().Wait();
}
}
}