mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-08-21 17:03:05 +00:00
fix: Don't panic when receiving PDUs with illegal auth events
Apparently some servers do this??
This commit is contained in:
@@ -170,12 +170,13 @@ pub async fn handle_outlier_pdu<'a, Pdu>(
|
||||
.expect("we just checked that we have all auth events")
|
||||
.to_owned();
|
||||
|
||||
let key = auth_event.kind().with_state_key(
|
||||
auth_event
|
||||
.state_key
|
||||
.clone()
|
||||
.expect("all auth events must have state keys"),
|
||||
);
|
||||
let Some(state_key) = auth_event.state_key() else {
|
||||
self.reject_and_persist(event_id, &incoming_pdu);
|
||||
return Err!(Request(Forbidden(debug_warn!(
|
||||
"Event references non-state event as an auth event: {id}",
|
||||
))));
|
||||
};
|
||||
let key = auth_event.kind().with_state_key(state_key);
|
||||
match auth_events_by_key.entry(key) {
|
||||
| hash_map::Entry::Vacant(v) => {
|
||||
v.insert(auth_event);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
routing::{get, on},
|
||||
};
|
||||
use conduwuit_api::client_ip::ClientIp;
|
||||
use conduwuit_core::{config::TermsDocument, info, warn};
|
||||
use conduwuit_core::{config::TermsDocument, warn};
|
||||
use conduwuit_service::{
|
||||
mailer::messages,
|
||||
registration_tokens::ValidToken,
|
||||
|
||||
Reference in New Issue
Block a user