mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-14 23:19:07 -05:00
Correct length check for Close messages
This commit is contained in:
parent
ecf2cf3094
commit
439174417a
|
@ -29,7 +29,7 @@ impl<'de> Deserialize<'de> for Close {
|
||||||
.ok_or(serde::de::Error::custom("not array"))?;
|
.ok_or(serde::de::Error::custom("not array"))?;
|
||||||
|
|
||||||
// check length
|
// check length
|
||||||
if va.len() == 2 {
|
if va.len() != 2 {
|
||||||
return Err(serde::de::Error::custom("not exactly 2 fields"));
|
return Err(serde::de::Error::custom("not exactly 2 fields"));
|
||||||
}
|
}
|
||||||
let mut i = va.into_iter();
|
let mut i = va.into_iter();
|
||||||
|
|
|
@ -87,8 +87,8 @@ async fn process_client(stream: WebSocketStream<TcpStream>) {
|
||||||
)))
|
)))
|
||||||
.await
|
.await
|
||||||
.expect("send failed");
|
.expect("send failed");
|
||||||
|
// Handle this request. Everything else below is basically websocket error handling.
|
||||||
proto.process_message(cmd);
|
proto.process_message(cmd);
|
||||||
// Handle this request. Everything else below is basically error handling.
|
|
||||||
}
|
}
|
||||||
Ok(Message::Binary(_)) => {
|
Ok(Message::Binary(_)) => {
|
||||||
info!("Ignoring Binary message");
|
info!("Ignoring Binary message");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user