Merge pull request #7439 from dsplaisted/fix-obtain-master

Fix dotnet-install.ps1 script when latest version file for channel is returned as application/octet-stream
This commit is contained in:
Daniel Plaisted 2017-08-15 12:16:29 -07:00 committed by GitHub
commit 6ed4e12ee8

View file

@ -232,7 +232,7 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [bool]$Co
$StringContent = $Response.Content.ReadAsStringAsync().Result
switch ($Response.Content.Headers.ContentType) {
{ ($_ -eq "application/octet-stream") } { $VersionText = [Text.Encoding]::UTF8.GetString($StringContent) }
{ ($_ -eq "application/octet-stream") } { $VersionText = $StringContent }
{ ($_ -eq "text/plain") } { $VersionText = $StringContent }
{ ($_ -eq "text/plain; charset=UTF-8") } { $VersionText = $StringContent }
default { throw "``$Response.Content.Headers.ContentType`` is an unknown .version file content type." }