mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
Verify Send file does not exist before saving file (#1515)
* Verify Send file does not exist before saving file * Fix flaky test
This commit is contained in:
@ -130,6 +130,11 @@ namespace Bit.Core.Services
|
||||
|
||||
var data = JsonConvert.DeserializeObject<SendFileData>(send.Data);
|
||||
|
||||
if (data.Validated)
|
||||
{
|
||||
throw new BadRequestException("File has already been uploaded.");
|
||||
}
|
||||
|
||||
await _sendFileStorageService.UploadNewFileAsync(stream, send, data.Id);
|
||||
|
||||
if (!await ValidateSendFile(send))
|
||||
|
Reference in New Issue
Block a user