Skip to content

Commit

Permalink
fix(hermes): fix ip whitelisting logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-bahjati committed Oct 11, 2023
1 parent bb922c3 commit eb2fd83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hermes/src/api/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))?,
Expand Down

0 comments on commit eb2fd83

Please sign in to comment.