Skip to content

Commit eb2fd83

Browse files
committed
fix(hermes): fix ip whitelisting logic
1 parent bb922c3 commit eb2fd83

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hermes/src/api/ws.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ impl Subscriber {
294294
if !self
295295
.ws_state
296296
.bytes_limit_whitelist
297-
.contains(&self.ip_addr.into())
297+
.iter()
298+
.any(|ip_net| ip_net.contains(&self.ip_addr))
298299
&& self.ws_state.rate_limiter.check_key_n(
299300
&self.ip_addr,
300301
NonZeroU32::new(message.len().try_into()?).ok_or(anyhow!("Empty message"))?,

0 commit comments

Comments
 (0)