mirror of
https://github.com/bitwarden/jslib
synced 2025-12-20 10:13:43 +00:00
Use encrypted filename filename in Cipher attachment upload blob name (#403)
* Use EncString type to enforce encryption on filename in Cipher attachment upload * Fix Cipher attachment test
This commit is contained in:
@@ -638,7 +638,7 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
try {
|
||||
const uploadDataResponse = await this.apiService.postCipherAttachment(cipher.id, request);
|
||||
response = admin ? uploadDataResponse.cipherMiniResponse : uploadDataResponse.cipherResponse;
|
||||
await this.fileUploadService.uploadCipherAttachment(admin, uploadDataResponse, filename, encData);
|
||||
await this.fileUploadService.uploadCipherAttachment(admin, uploadDataResponse, encFileName, encData);
|
||||
} catch (e) {
|
||||
if (e instanceof ErrorResponse && (e as ErrorResponse).statusCode === 404 || (e as ErrorResponse).statusCode === 405) {
|
||||
response = await this.legacyServerAttachmentFileUpload(admin, cipher.id, encFileName, encData, dataEncKey[1]);
|
||||
|
||||
Reference in New Issue
Block a user