From bac28460538ed615464e2c5431249dee36bb7644 Mon Sep 17 00:00:00 2001 From: Anton Smolkov Date: Fri, 7 May 2021 23:22:26 +0300 Subject: [PATCH] fix(JsonGzipHttpClient): flush gzipstream to underlying stream (#191) Add data flushing from GzipStream to underlying stream. Fixes #190 Co-authored-by: Anton Smolkov --- .../Sinks/Http/HttpClients/JsonGzipHttpClient.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Serilog.Sinks.Http/Sinks/Http/HttpClients/JsonGzipHttpClient.cs b/src/Serilog.Sinks.Http/Sinks/Http/HttpClients/JsonGzipHttpClient.cs index 926f4e17..a13ff234 100644 --- a/src/Serilog.Sinks.Http/Sinks/Http/HttpClients/JsonGzipHttpClient.cs +++ b/src/Serilog.Sinks.Http/Sinks/Http/HttpClients/JsonGzipHttpClient.cs @@ -81,7 +81,8 @@ public virtual async Task PostAsync(string requestUri, Stre await contentStream .CopyToAsync(gzipStream) .ConfigureAwait(false); - + await gzipStream.FlushAsync(); + output.Position = 0; var content = new StreamContent(output);