Skip to content

Commit

Permalink
Fix: Overwrite user agent to get mysql apps via azure automation
Browse files Browse the repository at this point in the history
  • Loading branch information
BornToBeRoot authored Nov 8, 2024
1 parent 82d8813 commit 35b78b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Evergreen/Apps/Get-mySQLConnectorNET.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function Get-mySQLConnectorNET {
# The version ist major.minor.patch, while the tag can have also have major.minor.patch.build
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceVersionShort, (($Version -split '\.')[0, 1] -join '.') -replace $res.Get.Download.ReplaceVersion, (($Version -split '\.')[0..2] -join '.')

$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]
# The website/CDN checks the user agent, which means that the call from e.g. Azure Automation is only possible by overwriting it
$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -UserAgent "Curl/8" -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]

$PSObject = [PSCustomObject] @{
Version = $Version
Expand Down
3 changes: 2 additions & 1 deletion Evergreen/Apps/Get-mySQLConnectorODBC.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function Get-mySQLConnectorODBC {
# The version ist major.minor.patch, while the tag can have also have major.minor.patch.build
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceVersion, (($Version -split '\.')[0..2] -join '.')

$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]
# The website/CDN checks the user agent, which means that the call from e.g. Azure Automation is only possible by overwriting it
$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -UserAgent "Curl/8" -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]

$PSObject = [PSCustomObject] @{
Version = $Version
Expand Down
3 changes: 2 additions & 1 deletion Evergreen/Apps/Get-mySQLWorkbench.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function Get-mySQLWorkbench {
# The version ist major.minor.patch, while the tag can have also have major.minor.patch.build
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceVersion, (($Version -split '\.')[0..2] -join '.')

$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]
# The website/CDN checks the user agent, which means that the call from e.g. Azure Automation is only possible by overwriting it
$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -UserAgent "Curl/8" -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]

$PSObject = [PSCustomObject] @{
Version = $Version
Expand Down

0 comments on commit 35b78b9

Please sign in to comment.