mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-24 01:17:34 +00:00
fix(rendezvous): Return 404 when deleting an expired session
This commit is contained in:
1 file changed
+5
-1
@@ -184,8 +184,12 @@ impl Service {
|
||||
id: &str,
|
||||
) -> Result<delete_rendezvous_session::msc4388::Response> {
|
||||
let mut sessions = self.sessions.lock();
|
||||
let now = Instant::now();
|
||||
|
||||
if sessions.remove(id).is_some() {
|
||||
if sessions
|
||||
.remove(id)
|
||||
.is_some_and(|session| !session.is_expired(now))
|
||||
{
|
||||
Ok(delete_rendezvous_session::msc4388::Response::new())
|
||||
} else {
|
||||
Err!(Request(NotFound("Unknown session")))
|
||||
|
||||
Reference in new issue
Block a user