Skip to content

Commit

Permalink
[get-boost] add user-agent to dowload request header
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasDuvinage authored Oct 28, 2024
1 parent 3b5eda9 commit 2552438
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions utils/get-boost.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ function DownloadFileWithRetry
}
try
{
(New-Object System.Net.WebClient).DownloadFile($Url, $Out)
using (WebClient wc = new WebClient())
{
wc.Headers.Add("User-Agent: Other");
wc.DownloadFile($Url, $Out);
}
break
}
catch
Expand All @@ -36,7 +40,7 @@ function DownloadFileWithRetry
Get-FileHash $Out | Format-List
}
}
$Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.83.0/boost_1_83_0-msvc-14.3-64.exe/download"
$Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.83.0/boost_1_83_0-msvc-14.3-64.exe"
$Out = "$env:TEMP\boost.exe"
echo "$Out"
DownloadFileWithRetry -Url "$Url" -Out "$Out"
Expand Down

0 comments on commit 2552438

Please sign in to comment.