diff options
author | Daniel García <[email protected]> | 2024-06-19 17:00:41 +0200 |
---|---|---|
committer | Daniel García <[email protected]> | 2024-06-19 17:01:37 +0200 |
commit | 813994e9baaee0c3365a82b73aa5b47a39a3f9a6 (patch) | |
tree | 20f9f93efee6848b8424c8eafbcf043152a5aa9f /src | |
parent | 716c9adc87b4ae444064cfb8bc327555f8fefa13 (diff) | |
download | vaultwarden-813994e9baaee0c3365a82b73aa5b47a39a3f9a6.tar.gz vaultwarden-813994e9baaee0c3365a82b73aa5b47a39a3f9a6.zip |
Make sends lowercase
Diffstat (limited to 'src')
-rw-r--r-- | src/db/models/send.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/db/models/send.rs b/src/db/models/send.rs index ad842659..02c8c759 100644 --- a/src/db/models/send.rs +++ b/src/db/models/send.rs @@ -1,6 +1,8 @@ use chrono::{NaiveDateTime, Utc}; use serde_json::Value; +use crate::util::LowerCase; + use super::User; db_object! { @@ -122,7 +124,7 @@ impl Send { use data_encoding::BASE64URL_NOPAD; use uuid::Uuid; - let data: Value = serde_json::from_str(&self.data).unwrap_or_default(); + let data = serde_json::from_str::<LowerCase<Value>>(&self.data).map(|d| d.data).unwrap_or_default(); json!({ "id": self.uuid, @@ -151,7 +153,7 @@ impl Send { pub async fn to_json_access(&self, conn: &mut DbConn) -> Value { use crate::util::format_date; - let data: Value = serde_json::from_str(&self.data).unwrap_or_default(); + let data = serde_json::from_str::<LowerCase<Value>>(&self.data).map(|d| d.data).unwrap_or_default(); json!({ "id": self.uuid, |