mirror of
https://github.com/bitwarden/server.git
synced 2025-05-28 23:04:50 -05:00
wrap file body stream in using block
This commit is contained in:
parent
576b85f125
commit
18b60e5350
@ -27,12 +27,14 @@ namespace Bit.Api.Utilities
|
|||||||
var fileNumber = 1;
|
var fileNumber = 1;
|
||||||
while(section != null && fileNumber <= fileCount)
|
while(section != null && fileNumber <= fileCount)
|
||||||
{
|
{
|
||||||
ContentDispositionHeaderValue content;
|
if(ContentDispositionHeaderValue.TryParse(section.ContentDisposition, out var content) &&
|
||||||
if(ContentDispositionHeaderValue.TryParse(section.ContentDisposition, out content) &&
|
|
||||||
HasFileContentDisposition(content))
|
HasFileContentDisposition(content))
|
||||||
{
|
{
|
||||||
var fileName = HeaderUtilities.RemoveQuotes(content.FileName) ?? string.Empty;
|
var fileName = HeaderUtilities.RemoveQuotes(content.FileName) ?? string.Empty;
|
||||||
await callback(section.Body, fileName);
|
using(section.Body)
|
||||||
|
{
|
||||||
|
await callback(section.Body, fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fileNumber >= fileCount)
|
if(fileNumber >= fileCount)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user