Fixed mask

This commit is contained in:
2026-02-18 23:14:08 +01:00
parent a14a989691
commit ce1e0a05d4
2 changed files with 1 additions and 4 deletions
-3
View File
@@ -47,9 +47,6 @@ async fn main() -> session_rs::Result<()> {
} }
} }
} }
let _ = session.close().await;
println!("Connection {} closed", addr);
}); });
} }
} }
+1 -1
View File
@@ -143,7 +143,7 @@ impl Session {
} }
// --- 3. Read mask key --- // --- 3. Read mask key ---
if !masked { if !masked && !self.mask_payload {
// Per spec, client-to-server frames MUST be masked // Per spec, client-to-server frames MUST be masked
self.close().await.ok(); self.close().await.ok();
return Err(crate::Error::InvalidFrame( return Err(crate::Error::InvalidFrame(