Fix build warning (tests do not enable nullable)

This commit is contained in:
Caelan Sayler
2025-05-18 09:55:38 +01:00
committed by Caelan
parent 49d46319b8
commit d05fdd607b
2 changed files with 2 additions and 3 deletions

View File

@@ -9,7 +9,6 @@ using System.Threading.Tasks;
namespace Velopack.Sources
{
/// <inheritdoc cref="IFileDownloader"/>
public class HttpClientFileDownloader : IFileDownloader
{
@@ -72,7 +71,7 @@ namespace Velopack.Sources
{
// https://stackoverflow.com/a/46497896/184746
// Get the http headers first to examine the content length
using var response = await client.GetAsync(requestUri, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
using var response = await client.GetAsync(requestUri, HttpCompletionOption.ResponseHeadersRead, cancelToken).ConfigureAwait(false);
response.EnsureSuccessStatusCode();
var contentLength = response.Content.Headers.ContentLength;

View File

@@ -7,7 +7,7 @@ public class FakeDownloader : IFileDownloader
{
public string LastUrl { get; private set; }
public string LastLocalFile { get; private set; }
public IDictionary<string, string>? LastHeaders { get; private set; }
public IDictionary<string, string> LastHeaders { get; private set; } = new Dictionary<string, string>();
public byte[] MockedResponseBytes { get; set; } = [];
public bool WriteMockLocalFile { get; set; } = false;