From 2aa0a2474b9f2f7b9c091b70e48ce3b37d52ab85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6sters?= Date: Wed, 22 Feb 2023 09:32:47 +0100 Subject: [PATCH] fix: ignore unparsable pdus in /send --- src/api/server_server.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/api/server_server.rs b/src/api/server_server.rs index e95a560b..adf4bc26 100644 --- a/src/api/server_server.rs +++ b/src/api/server_server.rs @@ -688,7 +688,14 @@ pub async fn send_transaction_message_route( // let mut auth_cache = EventMap::new(); for pdu in &body.pdus { - let (event_id, value, room_id) = parse_incoming_pdu(&pdu)?; + let r = parse_incoming_pdu(&pdu); + let (event_id, value, room_id) = match r { + Ok(t) => t, + Err(e) => { + warn!("Could not parse pdu: {e}"); + continue; + } + }; // We do not add the event_id field to the pdu here because of signature and hashes checks services()