1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

Fix send file length always zero (#1175)

* HttpStream must be read prior to knowing it length

We also need to create the send prior to saving the stream so we
have well defined save location. Solve chicken-and-egg problem by saving
the Send twice. This also allows for validation that the stream received
is the same length as that promissed by the content-length header

* Get encrypted file length from request
This commit is contained in:
Matt Gibson
2021-03-02 09:27:11 -06:00
committed by GitHub
parent 8d5fc21b51
commit c2d34d7271
3 changed files with 16 additions and 2 deletions

View File

@ -13,6 +13,7 @@ namespace Bit.Core.Models.Api
public class SendRequestModel
{
public SendType Type { get; set; }
public long? FileLength { get; set; }
[EncryptedString]
[EncryptedStringLength(1000)]
public string Name { get; set; }