mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
[PM 1672] SecureSafe Import Url Header Fix (#6623)
* Get the url field name ignoring the case format * Adding test cases for the SecureSafe importer * Updating test cases and the way the url field is selected * updating the variable name from url to urlField
This commit is contained in:
@@ -12,11 +12,13 @@ export class SecureSafeCsvImporter extends BaseImporter implements Importer {
|
||||
return Promise.resolve(result);
|
||||
}
|
||||
|
||||
// The url field can be in different case formats.
|
||||
const urlField = Object.keys(results[0]).find((k) => /url/i.test(k));
|
||||
results.forEach((value) => {
|
||||
const cipher = this.initLoginCipher();
|
||||
cipher.name = this.getValueOrDefault(value.Title);
|
||||
cipher.notes = this.getValueOrDefault(value.Comment);
|
||||
cipher.login.uris = this.makeUriArray(value.Url);
|
||||
cipher.login.uris = this.makeUriArray(value[urlField]);
|
||||
cipher.login.password = this.getValueOrDefault(value.Password);
|
||||
cipher.login.username = this.getValueOrDefault(value.Username);
|
||||
this.cleanupCipher(cipher);
|
||||
|
||||
Reference in New Issue
Block a user