fix(hermes): fix ip whitelisting logic

This commit is contained in:
Ali Behjati 2023-10-11 18:13:35 +02:00
parent bb922c3a17
commit eb2fd83e61
1 changed files with 2 additions and 1 deletions

View File

@ -294,7 +294,8 @@ impl Subscriber {
if !self
.ws_state
.bytes_limit_whitelist
.contains(&self.ip_addr.into())
.iter()
.any(|ip_net| ip_net.contains(&self.ip_addr))
&& self.ws_state.rate_limiter.check_key_n(
&self.ip_addr,
NonZeroU32::new(message.len().try_into()?).ok_or(anyhow!("Empty message"))?,