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.
This commit is contained in:
Matt Gibson 2021-04-20 19:17:31 -05:00 committed by GitHub
parent 3a1087456f
commit 1f62b22285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -192,7 +192,7 @@ export abstract class ApiService {
putSend: (id: string, request: SendRequest) => Promise<SendResponse>;
putSendRemovePassword: (id: string) => Promise<SendResponse>;
deleteSend: (id: string) => Promise<any>;
getSendFileDownloadData: (send: SendAccessView, request: SendAccessRequest) => Promise<SendFileDownloadDataResponse>;
getSendFileDownloadData: (send: SendAccessView, request: SendAccessRequest, apiUrl?: string) => Promise<SendFileDownloadDataResponse>;
renewSendFileUploadUrl: (sendId: string, fileId: string) => Promise<SendFileUploadDataResponse>;
getCipher: (id: string) => Promise<CipherResponse>;

View File

@ -423,8 +423,8 @@ export class ApiService implements ApiServiceAbstraction {
}
async getSendFileDownloadData(send: SendAccessView, request: SendAccessRequest): Promise<SendFileDownloadDataResponse> {
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<SendFileDownloadDataResponse> {
const r = await this.send('POST', '/sends/' + send.id + '/access/file/' + send.file.id, request, false, true, apiUrl);
return new SendFileDownloadDataResponse(r);
}