Browse Source

dispose of the remoteStream object.

pull/9180/head
maliming 5 years ago
parent
commit
ec22181ba6
  1. 7
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs

7
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs

@ -1,5 +1,4 @@
using System;
using System.Buffers;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.Net.Http.Headers;
@ -34,9 +33,9 @@ namespace Volo.Abp.AspNetCore.Mvc.ContentFormatters
context.HttpContext.Response.Headers[HeaderNames.ContentDisposition] = contentDisposition.ToString();
}
using (var stream = remoteStream.GetStream())
{
await stream.CopyToAsync(context.HttpContext.Response.Body);
using (remoteStream)
{
await remoteStream.GetStream().CopyToAsync(context.HttpContext.Response.Body);
}
}
}

Loading…
Cancel
Save