0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2024-12-31 00:53:52 -05:00

Fix issues when uri match is a string (#5332)

This commit is contained in:
Mathijs van Veluw 2024-12-29 21:26:03 +01:00 committed by GitHub
parent ed4ad67e73
commit d9b043d32c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -242,6 +242,14 @@ impl Cipher {
// Set the first element of the Uris array as Uri, this is needed several (mobile) clients.
if self.atype == 1 {
if type_data_json["uris"].is_array() {
// Fix uri match values first, they are only allowed to be a number or null
// If it is a string, convert it to null since all clients do not allow strings anyway
let uri_count = type_data_json["uris"].as_array().unwrap().len();
for n in 0..uri_count {
if type_data_json["uris"][n]["match"].is_string() {
type_data_json["uris"][n]["match"] = Value::Null;
}
}
let uri = type_data_json["uris"][0]["uri"].clone();
type_data_json["uri"] = uri;
} else {