1
0
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:
Kyle Spearrin 2017-08-31 09:25:54 -04:00
parent 576b85f125
commit 18b60e5350

View File

@ -27,13 +27,15 @@ namespace Bit.Api.Utilities
var fileNumber = 1;
while(section != null && fileNumber <= fileCount)
{
ContentDispositionHeaderValue content;
if(ContentDispositionHeaderValue.TryParse(section.ContentDisposition, out content) &&
if(ContentDispositionHeaderValue.TryParse(section.ContentDisposition, out var content) &&
HasFileContentDisposition(content))
{
var fileName = HeaderUtilities.RemoveQuotes(content.FileName) ?? string.Empty;
using(section.Body)
{
await callback(section.Body, fileName);
}
}
if(fileNumber >= fileCount)
{