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:
parent
88c1340f6d
commit
0dad10253b
1 changed files with 5 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue