From bbba7551b7a6bff55d78d6f7c17c94b8b06bd6c5 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Thu, 7 Nov 2024 10:47:02 +0900 Subject: [PATCH] Minor forgotten dispose in tests --- BTCPayServer.Client/BTCPayServerClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BTCPayServer.Client/BTCPayServerClient.cs b/BTCPayServer.Client/BTCPayServerClient.cs index 1e3a03535..85adbddf8 100644 --- a/BTCPayServer.Client/BTCPayServerClient.cs +++ b/BTCPayServer.Client/BTCPayServerClient.cs @@ -156,7 +156,7 @@ public partial class BTCPayServerClient protected virtual async Task UploadFileRequest(string apiPath, string filePath, string mimeType, string formFieldName, HttpMethod method = null, CancellationToken token = default) { using MultipartFormDataContent multipartContent = new(); - var fileContent = new StreamContent(File.OpenRead(filePath)); + using var fileContent = new StreamContent(File.OpenRead(filePath)); var fileName = Path.GetFileName(filePath); fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse(mimeType); multipartContent.Add(fileContent, formFieldName, fileName);