mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 05:54:26 +01:00
Minor forgotten dispose in tests
This commit is contained in:
@@ -156,7 +156,7 @@ public partial class BTCPayServerClient
|
|||||||
protected virtual async Task<T> UploadFileRequest<T>(string apiPath, string filePath, string mimeType, string formFieldName, HttpMethod method = null, CancellationToken token = default)
|
protected virtual async Task<T> UploadFileRequest<T>(string apiPath, string filePath, string mimeType, string formFieldName, HttpMethod method = null, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
using MultipartFormDataContent multipartContent = new();
|
using MultipartFormDataContent multipartContent = new();
|
||||||
var fileContent = new StreamContent(File.OpenRead(filePath));
|
using var fileContent = new StreamContent(File.OpenRead(filePath));
|
||||||
var fileName = Path.GetFileName(filePath);
|
var fileName = Path.GetFileName(filePath);
|
||||||
fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse(mimeType);
|
fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse(mimeType);
|
||||||
multipartContent.Add(fileContent, formFieldName, fileName);
|
multipartContent.Add(fileContent, formFieldName, fileName);
|
||||||
|
|||||||
Reference in New Issue
Block a user