Skip to content

Commit

Permalink
chore: only send the JSON header once when sending metrics and regist…
Browse files Browse the repository at this point in the history
…ration payloads
  • Loading branch information
sighphyre committed Oct 31, 2024
1 parent 8d34399 commit 94e68a0
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/Unleash/Communication/UnleashApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ public async Task<bool> RegisterClient(ClientRegistration registration, Cancella
using (var request = new HttpRequestMessage(HttpMethod.Post, requestUri))
{
request.Content = new StringContent(JsonSerializer.Serialize(registration, options), Encoding.UTF8, "application/json");
request.Content.Headers.AddContentTypeJson();

SetRequestHeaders(request, clientRequestHeaders);

Expand Down Expand Up @@ -230,7 +229,6 @@ public async Task<bool> SendMetrics(Yggdrasil.MetricsBucket metrics, Cancellatio
using (var request = new HttpRequestMessage(HttpMethod.Post, requestUri))
{
request.Content = new StringContent(JsonSerializer.Serialize(clientMetrics, options), Encoding.UTF8, "application/json");
request.Content.Headers.AddContentTypeJson();

SetRequestHeaders(request, clientRequestHeaders);

Expand Down

0 comments on commit 94e68a0

Please sign in to comment.