Skip to content

Commit

Permalink
Fixes adding additional QueryParameters to http request (#838)
Browse files Browse the repository at this point in the history
* Fixes adding aditional QueryParameters to http request

* Update tests

* Fix formatting

* Undo change

* Remove unused code
  • Loading branch information
tvdias committed Aug 23, 2023
1 parent 59865de commit af5e161
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Minio/HttpRequestMessageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using System.Globalization;
using System.Net.Http.Headers;
using System.Text;
using System.Web;
using Minio.Exceptions;

namespace Minio;
Expand Down Expand Up @@ -61,13 +60,6 @@ public HttpRequestMessage Request
get
{
var requestUriBuilder = new UriBuilder(RequestUri);

foreach (var queryParameter in QueryParameters)
{
var query = HttpUtility.ParseQueryString(requestUriBuilder.Query);
requestUriBuilder.Query = query.ToString();
}

var requestUri = requestUriBuilder.Uri;
var request = new HttpRequestMessage(Method, requestUri);

Expand Down Expand Up @@ -95,12 +87,15 @@ public HttpRequestMessage Request
}

break;

case "content-length":
request.Content.Headers.ContentLength = Convert.ToInt32(val, CultureInfo.InvariantCulture);
break;

case "content-md5":
request.Content.Headers.ContentMD5 = Convert.FromBase64String(val);
break;

default:
var errMessage = "Unsupported signed header: (" + key + ": " + val;
throw new UnexpectedMinioException(errMessage);
Expand Down

0 comments on commit af5e161

Please sign in to comment.