1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-19 02:51:14 +02:00

Include File size in SendRequest (#289)

This commit is contained in:
Matt Gibson 2021-03-02 09:46:46 -06:00 committed by GitHub
parent 70654926ad
commit 3942868cf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import { Send } from '../domain/send';
export class SendRequest { export class SendRequest {
type: SendType; type: SendType;
fileLength?: number;
name: string; name: string;
notes: string; notes: string;
key: string; key: string;
@ -18,8 +19,9 @@ export class SendRequest {
password: string; password: string;
disabled: boolean; disabled: boolean;
constructor(send: Send) { constructor(send: Send, fileLength?: number) {
this.type = send.type; this.type = send.type;
this.fileLength = fileLength;
this.name = send.name ? send.name.encryptedString : null; this.name = send.name ? send.name.encryptedString : null;
this.notes = send.notes ? send.notes.encryptedString : null; this.notes = send.notes ? send.notes.encryptedString : null;
this.maxAccessCount = send.maxAccessCount; this.maxAccessCount = send.maxAccessCount;

View File

@ -127,7 +127,7 @@ export class SendService implements SendServiceAbstraction {
} }
async saveWithServer(sendData: [Send, ArrayBuffer]): Promise<any> { async saveWithServer(sendData: [Send, ArrayBuffer]): Promise<any> {
const request = new SendRequest(sendData[0]); const request = new SendRequest(sendData[0], sendData[1]?.byteLength);
let response: SendResponse; let response: SendResponse;
if (sendData[0].id == null) { if (sendData[0].id == null) {
if (sendData[0].type === SendType.Text) { if (sendData[0].type === SendType.Text) {