fix: handle nested data in serde_qs deserialization correctly (#1183)

This commit is contained in:
hchockarprasad 2023-06-15 19:45:10 +05:30 committed by GitHub
parent d15ba11104
commit 601db7aa86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -692,6 +692,6 @@ where
web_sys::UrlSearchParams::new_with_str_sequence_sequence(form_data)
.unwrap_throw();
let data = data.to_string().as_string().unwrap_or_default();
serde_qs::from_str::<Self>(&data)
serde_qs::Config::new(5, false).deserialize_str::<Self>(&data)
}
}

View file

@ -375,7 +375,8 @@ where
// decode the args
let value = match Self::encoding() {
Encoding::Url | Encoding::GetJSON | Encoding::GetCBOR => {
serde_qs::from_bytes(data)
serde_qs::Config::new(5, false)
.deserialize_bytes(data)
.map_err(|e| ServerFnError::Deserialization(e.to_string()))
}
Encoding::Cbor => ciborium::de::from_reader(data)