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,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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user