Skip to content

Commit

Permalink
[release/8.0] Prepend ? when dealing with runtime query string prefix…
Browse files Browse the repository at this point in the history
…es (#14945)
  • Loading branch information
mmitche authored Jul 17, 2024
1 parent 5219b9a commit 9c9fe32
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Microsoft.DotNet.Arcade.Sdk/src/DownloadFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ public override bool Execute()
{
var encodedTokenBytes = System.Convert.FromBase64String(encodedToken);
var decodedToken = System.Text.Encoding.UTF8.GetString(encodedTokenBytes);
// It's possible that the decoded SAS does not begin with the query string parameter.
// Handle cleanly before constructing the final URL
if (!decodedToken.StartsWith("?"))
{
decodedToken = $"?{decodedToken}";
}
uri = $"{uri}{decodedToken}";
}

Expand Down

0 comments on commit 9c9fe32

Please sign in to comment.