From 1f62b22285a13d0088b5424c96013cc8589d0242 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Tue, 20 Apr 2021 19:17:31 -0500 Subject: [PATCH] CLI specifies bitwarden api for send download (#348) This is needed for CLI to download Send files from non-configured Bitwarden Servers. Web does not have this issue because it can assume api from its own url. --- src/abstractions/api.service.ts | 2 +- src/services/api.service.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/abstractions/api.service.ts b/src/abstractions/api.service.ts index 914afce6b0..ee4a444b05 100644 --- a/src/abstractions/api.service.ts +++ b/src/abstractions/api.service.ts @@ -192,7 +192,7 @@ export abstract class ApiService { putSend: (id: string, request: SendRequest) => Promise; putSendRemovePassword: (id: string) => Promise; deleteSend: (id: string) => Promise; - getSendFileDownloadData: (send: SendAccessView, request: SendAccessRequest) => Promise; + getSendFileDownloadData: (send: SendAccessView, request: SendAccessRequest, apiUrl?: string) => Promise; renewSendFileUploadUrl: (sendId: string, fileId: string) => Promise; getCipher: (id: string) => Promise; diff --git a/src/services/api.service.ts b/src/services/api.service.ts index dc72e3f1f1..81eb3f9076 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -423,8 +423,8 @@ export class ApiService implements ApiServiceAbstraction { } - async getSendFileDownloadData(send: SendAccessView, request: SendAccessRequest): Promise { - const r = await this.send('POST', '/sends/' + send.id + '/access/file/' + send.file.id, request, false, true); + async getSendFileDownloadData(send: SendAccessView, request: SendAccessRequest, apiUrl?: string): Promise { + const r = await this.send('POST', '/sends/' + send.id + '/access/file/' + send.file.id, request, false, true, apiUrl); return new SendFileDownloadDataResponse(r); }