mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-20 18:48:10 +08:00
fix(wxapi): 修复潜在的内存泄漏问题
This commit is contained in:
@@ -31,8 +31,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
string boundary = "--BOUNDARY--" + DateTimeOffset.Now.Ticks.ToString("x");
|
||||
var httpContent = new MultipartFormDataContent(boundary);
|
||||
var fileContent = new ByteArrayContent(request.ImageFileBytes ?? new byte[0]);
|
||||
using var httpContent = new MultipartFormDataContent(boundary);
|
||||
using var fileContent = new ByteArrayContent(request.ImageFileBytes ?? new byte[0]);
|
||||
httpContent.Add(fileContent, "\"media\"", "\"image.png\"");
|
||||
httpContent.Headers.ContentType = MediaTypeHeaderValue.Parse("multipart/form-data; boundary=" + boundary);
|
||||
fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse("image/png");
|
||||
|
Reference in New Issue
Block a user