1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 21:18:13 -05:00

MultiplartSectionBody streams have 0 length until read. (#1196)

This commit is contained in:
Matt Gibson 2021-03-09 10:49:49 -06:00 committed by GitHub
parent 7d5b835a79
commit a83cbf965e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -222,10 +222,11 @@ namespace Bit.Core.Services
AttachmentId = attachmentId,
FileName = fileName,
Key = key,
Size = stream.Length
};
await _attachmentStorageService.UploadNewAttachmentAsync(stream, cipher, data);
// Must read stream length after it has been saved, otherwise it's 0
data.Size = stream.Length;
try
{