Skip to content

Commit

Permalink
fix(#1545): empty strings encryption
Browse files Browse the repository at this point in the history
enable empty strings to be encrypted
  • Loading branch information
mato-meciar committed Feb 15, 2024
1 parent bd002ca commit b6abc66
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/bruno-electron/src/store/env-secrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class EnvironmentSecretsStore {
}

isValidValue(val) {
return val && typeof val === 'string' && val.length > 0;
return typeof val === 'string' && val.length >= 0;
}

storeEnvSecrets(collectionPathname, environment) {
Expand Down
2 changes: 1 addition & 1 deletion packages/bruno-electron/src/utils/encryption.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function safeStorageDecrypt(str) {
}

function encryptString(str) {
if (!str || typeof str !== 'string' || str.length === 0) {
if (typeof str !== 'string') {
throw new Error('Encrypt failed: invalid string');
}

Expand Down

0 comments on commit b6abc66

Please sign in to comment.