Skip to content

Commit eeb41eb

Browse files
authored
[release/6.0] Prepend ? when dealing with runtime query string prefixes (#56837)
* Prepend ? when dealing with runtime query string prefixes * Update DownloadFile.cs * Update DownloadFile.cs
1 parent 30f9743 commit eeb41eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

eng/tools/RepoTasks/DownloadFile.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ private async System.Threading.Tasks.Task<bool> ExecuteAsync()
7373
{
7474
var uriSuffixBytes = System.Convert.FromBase64String(PrivateUriSuffix);
7575
uriSuffix = System.Text.Encoding.UTF8.GetString(uriSuffixBytes);
76+
77+
// Ensure that the url suffix starts with the query string prefix
78+
if (!uriSuffix.StartsWith("?", StringComparison.OrdinalIgnoreCase))
79+
{
80+
uriSuffix = $"?{uriSuffix}";
81+
}
7682
}
7783
downloadStatus = await DownloadWithRetriesAsync($"{PrivateUri}{uriSuffix}", DestinationPath, errorMessages);
7884
}

0 commit comments

Comments
 (0)