Fiz Gzip
This commit is contained in:
		| @@ -4,6 +4,7 @@ using Elecciones.Worker; | |||||||
| using Microsoft.EntityFrameworkCore; | using Microsoft.EntityFrameworkCore; | ||||||
| using Microsoft.Extensions.DependencyInjection; | using Microsoft.Extensions.DependencyInjection; | ||||||
| using Microsoft.Extensions.Hosting; | using Microsoft.Extensions.Hosting; | ||||||
|  | using System.Net; | ||||||
| using Serilog; | using Serilog; | ||||||
| using System.Net.Http; | using System.Net.Http; | ||||||
| using System.Net.Security; | using System.Net.Security; | ||||||
| @@ -54,6 +55,10 @@ builder.Services.AddHttpClient("ElectoralApiClient", client => | |||||||
| { | { | ||||||
|     var handler = new SocketsHttpHandler |     var handler = new SocketsHttpHandler | ||||||
|     { |     { | ||||||
|  |         // Habilita la descompresión automática de respuestas GZIP y Deflate. | ||||||
|  |         // Esto soluciona el error de JsonException ('0x1F'). | ||||||
|  |         AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate, | ||||||
|  |  | ||||||
|         SslOptions = new SslClientAuthenticationOptions |         SslOptions = new SslClientAuthenticationOptions | ||||||
|         { |         { | ||||||
|             EnabledSslProtocols = SslProtocols.Tls13, |             EnabledSslProtocols = SslProtocols.Tls13, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user