Skip to content

Commit 70440b5

Browse files
committed
fix(rust/signed-doc): fix content-type verification
1 parent 3a66559 commit 70440b5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

rust/signed_doc/src/content.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ impl Content {
4444
pub(crate) fn from_decoded(
4545
data: Vec<u8>, content_type: ContentType, content_encoding: Option<ContentEncoding>,
4646
) -> anyhow::Result<Self> {
47-
// TODO add content_type verification
4847
match content_type {
4948
ContentType::Json => {
50-
if let Err(e) = serde_json::from_slice::<serde_json::Value>(&data) {
49+
if let Err(e) = serde_json::to_value(&data) {
5150
anyhow::bail!("Invalid {content_type} content: {e}")
5251
}
5352
},

0 commit comments

Comments
 (0)