refactoring

This commit is contained in:
Mikhail Thompson
2024-06-28 21:13:21 +03:00
parent c7250cdf24
commit 1229104086
10 changed files with 228 additions and 310 deletions

View File

@@ -1,4 +1,5 @@
using EmbedIO;
using nksrv.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -19,14 +20,14 @@ namespace nksrv.IntlServer
protected override async Task HandleAsync()
{
Console.WriteLine("li-sg redirect in: " + Content);
HttpClientHandler handler = new HttpClientHandler()
HttpClientHandler handler = new()
{
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate,
ServerCertificateCustomValidationCallback = (httpRequestMessage, cert, cetChain, policyErrors) => true,
AllowAutoRedirect = true // from gameassembly dll
};
HttpClient client = new HttpClient(new LoggingHandler(handler));
HttpClient client = new(new LoggingHttpHandler(handler));
client.DefaultRequestHeaders
.Accept
.Add(new MediaTypeWithQualityHeaderValue("*/*"));//ACCEPT header