diff --git a/Natsurainko.FluentCore/Utils/HttpUtils.cs b/Natsurainko.FluentCore/Utils/HttpUtils.cs index 0a93018..08f1946 100644 --- a/Natsurainko.FluentCore/Utils/HttpUtils.cs +++ b/Natsurainko.FluentCore/Utils/HttpUtils.cs @@ -9,9 +9,6 @@ namespace Nrk.FluentCore.Utils; -#nullable disable -// TODO: refactor downloading system later - // TOOD: use internal public static class HttpUtils { @@ -19,34 +16,6 @@ public static class HttpUtils public static readonly IDownloader Downloader = new MultipartDownloader(HttpClient, 1024 * 1024, 8, 64); public static readonly MemoryPool MemoryPool = MemoryPool.Shared; - public static HttpResponseMessage HttpGet( - string url, - Tuple authorization = default, - HttpCompletionOption httpCompletionOption = HttpCompletionOption.ResponseContentRead) - { - using var requestMessage = new HttpRequestMessage(HttpMethod.Get, url); - - if (authorization != null) - requestMessage.Headers.Authorization = new AuthenticationHeaderValue( - authorization.Item1, - authorization.Item2 - ); - - var responseMessage = HttpClient.Send(requestMessage, httpCompletionOption, CancellationToken.None); - - if (responseMessage.StatusCode.Equals(HttpStatusCode.Found)) - { - string redirectUrl = responseMessage.Headers.Location.AbsoluteUri; - - responseMessage.Dispose(); - GC.Collect(); - - return HttpGet(redirectUrl, authorization, httpCompletionOption); - } - - return responseMessage; - } - public static string ReadAsString(this HttpContent content) { using var stream = content.ReadAsStream();