namespace MangaReader.Core.HttpService;

public class HttpService : IHttpService
{
    private readonly HttpClient _httpClient;

    public HttpService(HttpClient httpClient)
    {
        httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0");

        _httpClient = httpClient;
    }

    public Task<string> GetStringAsync(string url, CancellationToken cancellationToken)
        => _httpClient.GetStringAsync(url, cancellationToken);
}