From 272aef7b0815d14abcc2d929d344b6eb1b301ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sun, 2 Apr 2023 14:05:57 +0200 Subject: [PATCH] fix: prevent bonkers behavior on PUT (deny_unknown_fields) --- src/routes.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/routes.rs b/src/routes.rs index 2ddf57f..1fae5e9 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -332,7 +332,7 @@ pub struct InEntry { } #[derive(Debug, Clone, Deserialize)] -#[serde(untagged)] +#[serde(untagged, deny_unknown_fields)] pub enum PutInput { Entry(InEntry), EntryList(Vec), @@ -436,11 +436,7 @@ pub async fn put_object( let label_entry = match &address { Address::Hash(_) | Address::Uuid(_) => None, - Address::Attribute(attribute) => Some(Entry { - entity: address.clone(), - attribute: LABEL_ATTR.to_string(), - value: format!("ATTRIBUTE: {attribute}").into(), - }), + Address::Attribute(_) => None, Address::Url(url) => Some(Entry { entity: address.clone(), attribute: LABEL_ATTR.to_string(),