Skip to content

Commit

Permalink
Fixes the build error
Browse files Browse the repository at this point in the history
  • Loading branch information
ebozduman committed Apr 14, 2022
1 parent 18adb34 commit d0b499c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Minio/V4Authenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ private static string GetCanonicalHost(Uri url)
{
queryParams = string.Join("&", requestBuilder.QueryParameters.Select(kvp => $"{kvp.Key}={Uri.EscapeDataString(kvp.Value)}"));
}
var resource = requestBuilder.RequestUri.AbsolutePath + "?" + queryParams;

var isFormData = false;
var c = requestBuilder.Request.Content;
Expand Down Expand Up @@ -492,13 +491,16 @@ private static string GetCanonicalHost(Uri url)
if (sb1.Length > 0)
sb1.Append("&");
sb1.AppendFormat("{0}={1}", p, queryParamsDict[p]);
requestBuilder.AddQueryParameter(p, queryParamsDict[p]);
}
queryParams = sb1.ToString();
}

if (!string.IsNullOrEmpty(queryParams) && !isFormData)
if (!string.IsNullOrEmpty(queryParams) &&
!isFormData &&
requestBuilder.RequestUri.Query != "?location=")
{
requestBuilder.RequestUri = new Uri(requestBuilder.RequestUri + "?" + queryParams);
}

canonicalStringList.AddLast(requestBuilder.RequestUri.AbsolutePath);
canonicalStringList.AddLast(queryParams);

Expand Down

0 comments on commit d0b499c

Please sign in to comment.