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(AutomaticDecompression)
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-dev004 committed Jun 2, 2022
1 parent dd9b150 commit bf217af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public DiagnosisKeyRepository(
ILoggerService loggerService
)
{
_httpClient = httpClientService.Create();
_httpClient = httpClientService.Create(new HttpClientHandler
{
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
});
_loggerService = loggerService;
}

Expand Down
5 changes: 5 additions & 0 deletions Covid19Radar/Covid19Radar/Services/HttpClientService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Covid19Radar.Services
public interface IHttpClientService
{
HttpClient Create();
HttpClient Create(HttpClientHandler handler);
}
public class HttpClientService : IHttpClientService
{
Expand All @@ -20,5 +21,9 @@ public HttpClient Create()
{
return new HttpClient();
}
public HttpClient Create(HttpClientHandler handler)
{
return new HttpClient(handler);
}
}
}

0 comments on commit bf217af

Please sign in to comment.