From f17c732644ffd4be9870e69175e02d439659a4e8 Mon Sep 17 00:00:00 2001 From: John Luo Date: Thu, 1 Sep 2016 16:23:06 -0700 Subject: [PATCH] Release the buffer --- .../Internal/ResponseCacheStream.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCacheStream.cs b/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCacheStream.cs index 989e7aa..b8921b8 100644 --- a/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCacheStream.cs +++ b/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCacheStream.cs @@ -40,6 +40,8 @@ public override long Position public void DisableBuffering() { BufferingEnabled = false; + BufferedStream.SetLength(0); + BufferedStream.Capacity = 0; BufferedStream.Dispose(); }