Always append feed_credential to URIs in dotnet-install.{sh,ps1}
This commit is contained in:
parent
fd04fdd5f2
commit
9a8316cd12
2 changed files with 4 additions and 9 deletions
5
scripts/obtain/dotnet-install.ps1
vendored
5
scripts/obtain/dotnet-install.ps1
vendored
|
@ -203,10 +203,9 @@ function GetHTTPResponse([Uri] $Uri)
|
|||
# Default timeout for HttpClient is 100s. For a 50 MB download this assumes 500 KB/s average, any less will time out
|
||||
# 10 minutes allows it to work over much slower connections.
|
||||
$HttpClient.Timeout = New-TimeSpan -Minutes 10
|
||||
$ActualUri = if (($Uri -like "$AzureFeed*") -or ($Uri -like "$UncachedFeed*")) { "${Uri}${FeedCredential}" } else { $Uri }
|
||||
$Response = $HttpClient.GetAsync($ActualUri).Result
|
||||
$Response = $HttpClient.GetAsync("${Uri}${FeedCredential}").Result
|
||||
if (($Response -eq $null) -or (-not ($Response.IsSuccessStatusCode))) {
|
||||
# The feed credential is potential sensitive info. Do not log ActualUri to console output.
|
||||
# The feed credential is potentially sensitive info. Do not log FeedCredential to console output.
|
||||
$ErrorMsg = "Failed to download $Uri."
|
||||
if ($Response -ne $null) {
|
||||
$ErrorMsg += " $Response"
|
||||
|
|
8
scripts/obtain/dotnet-install.sh
vendored
8
scripts/obtain/dotnet-install.sh
vendored
|
@ -619,9 +619,7 @@ downloadcurl() {
|
|||
local out_path="${2:-}"
|
||||
|
||||
# Append feed_credential as late as possible before calling curl to avoid logging feed_credential
|
||||
if [[ "$remote_path" == "$azure_feed"* ]] || [[ "$remote_path" == "$uncached_feed"* ]]; then
|
||||
remote_path="${remote_path}${feed_credential}"
|
||||
fi
|
||||
remote_path="${remote_path}${feed_credential}"
|
||||
|
||||
local failed=false
|
||||
if [ -z "$out_path" ]; then
|
||||
|
@ -642,9 +640,7 @@ downloadwget() {
|
|||
local out_path="${2:-}"
|
||||
|
||||
# Append feed_credential as late as possible before calling wget to avoid logging feed_credential
|
||||
if [[ "$remote_path" == "$azure_feed"* ]] || [[ "$remote_path" == "$uncached_feed"* ]]; then
|
||||
remote_path="${remote_path}${feed_credential}"
|
||||
fi
|
||||
remote_path="${remote_path}${feed_credential}"
|
||||
|
||||
local failed=false
|
||||
if [ -z "$out_path" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue