Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Commit

Permalink
Added accept-encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-dev004 committed Jun 1, 2022
1 parent dd9b150 commit 1372757
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ ILoggerService loggerService

public async Task<(HttpStatusCode, IList<DiagnosisKeyEntry>)> GetDiagnosisKeysListAsync(string url, CancellationToken cancellationToken)
{
HttpResponseMessage response = await _httpClient.GetAsync(url, cancellationToken);
var request = new HttpRequestMessage(HttpMethod.Get, url);
request.Headers.AcceptEncoding.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("br"));
request.Headers.AcceptEncoding.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("deflate"));
request.Headers.AcceptEncoding.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("gzip"));
HttpResponseMessage response = await _httpClient.SendAsync(request, cancellationToken);
if (response.IsSuccessStatusCode)
{
string content = await response.Content.ReadAsStringAsync();
Expand Down

0 comments on commit 1372757

Please sign in to comment.