fix: dispose gzip stream

This commit is contained in:
Anna 2023-10-05 01:26:28 -04:00
parent 9d95363d01
commit 4d7f0599f3
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 3 additions and 2 deletions

View File

@ -84,8 +84,9 @@ public class Plugin : IDalamudPlugin {
Task.Run(async () => {
var mem = new MemoryStream();
var gz = new GZipStream(mem, CompressionLevel.Optimal);
gz.Write(Encoding.UTF8.GetBytes(json));
gz.Flush();
await gz.WriteAsync(Encoding.UTF8.GetBytes(json));
await gz.FlushAsync();
await gz.DisposeAsync();
var req = new HttpRequestMessage(HttpMethod.Post, "http://localhost:30888/upload") {
Content = new ByteArrayContent(mem.ToArray()) {