[win] specify accept header when downloading mysql meta (#8009)

as reported in https://github.com/actions/runner-images/issues/8004
dev.mysql.com behaviour has changed, it requires "Accept: text/html"
for download page

Co-authored-by: Miguel Nieto <m.nieto@kevull.com>
This commit is contained in:
ilia-shipitsin
2023-08-03 10:19:29 +02:00
committed by GitHub
parent 2a1b5d19a3
commit e1d1163c15

View File

@@ -15,7 +15,7 @@ Install-Binary -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentLi
$MysqlVersionMajorMinor = $MysqlVersion.ToString(2) $MysqlVersionMajorMinor = $MysqlVersion.ToString(2)
if ($MysqlVersion.Build -lt 0) { if ($MysqlVersion.Build -lt 0) {
$MysqlVersion = (Invoke-RestMethod -Uri "https://dev.mysql.com/downloads/mysql/${MysqlVersionMajorMinor}.html" | $MysqlVersion = (Invoke-RestMethod -Uri "https://dev.mysql.com/downloads/mysql/${MysqlVersionMajorMinor}.html" -Headers @{'Accept'='text/html'} |
Select-String -Pattern "${MysqlVersionMajorMinor}\.\d+").Matches.Value Select-String -Pattern "${MysqlVersionMajorMinor}\.\d+").Matches.Value
} }