1
0
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:
ttalty
2023-11-02 10:00:58 -04:00
committed by GitHub
parent b9cf29ff0c
commit db221dee05
3 changed files with 82 additions and 1 deletions

View File

@@ -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);