Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit 9a8316c

Browse files
author
Nate McMaster
committed
Always append feed_credential to URIs in dotnet-install.{sh,ps1}
1 parent fd04fdd commit 9a8316c

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

scripts/obtain/dotnet-install.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,9 @@ function GetHTTPResponse([Uri] $Uri)
203203
# Default timeout for HttpClient is 100s. For a 50 MB download this assumes 500 KB/s average, any less will time out
204204
# 10 minutes allows it to work over much slower connections.
205205
$HttpClient.Timeout = New-TimeSpan -Minutes 10
206-
$ActualUri = if (($Uri -like "$AzureFeed*") -or ($Uri -like "$UncachedFeed*")) { "${Uri}${FeedCredential}" } else { $Uri }
207-
$Response = $HttpClient.GetAsync($ActualUri).Result
206+
$Response = $HttpClient.GetAsync("${Uri}${FeedCredential}").Result
208207
if (($Response -eq $null) -or (-not ($Response.IsSuccessStatusCode))) {
209-
# The feed credential is potential sensitive info. Do not log ActualUri to console output.
208+
# The feed credential is potentially sensitive info. Do not log FeedCredential to console output.
210209
$ErrorMsg = "Failed to download $Uri."
211210
if ($Response -ne $null) {
212211
$ErrorMsg += " $Response"

scripts/obtain/dotnet-install.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -619,9 +619,7 @@ downloadcurl() {
619619
local out_path="${2:-}"
620620

621621
# Append feed_credential as late as possible before calling curl to avoid logging feed_credential
622-
if [[ "$remote_path" == "$azure_feed"* ]] || [[ "$remote_path" == "$uncached_feed"* ]]; then
623-
remote_path="${remote_path}${feed_credential}"
624-
fi
622+
remote_path="${remote_path}${feed_credential}"
625623

626624
local failed=false
627625
if [ -z "$out_path" ]; then
@@ -642,9 +640,7 @@ downloadwget() {
642640
local out_path="${2:-}"
643641

644642
# Append feed_credential as late as possible before calling wget to avoid logging feed_credential
645-
if [[ "$remote_path" == "$azure_feed"* ]] || [[ "$remote_path" == "$uncached_feed"* ]]; then
646-
remote_path="${remote_path}${feed_credential}"
647-
fi
643+
remote_path="${remote_path}${feed_credential}"
648644

649645
local failed=false
650646
if [ -z "$out_path" ]; then

0 commit comments

Comments
 (0)