We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 013c580 commit 3c2edd2Copy full SHA for 3c2edd2
crates/jmap/src/auth/rate_limit.rs
@@ -93,19 +93,20 @@ impl RateLimiter for Server {
93
94
async fn is_http_anonymous_request_allowed(&self, addr: &IpAddr) -> trc::Result<()> {
95
if let Some(rate) = &self.core.jmap.rate_anonymous {
96
- if self
97
- .core
98
- .storage
99
- .lookup
100
- .is_rate_allowed(
101
- KV_RATE_LIMIT_HTTP_ANONYMOUS,
102
- &ip_to_bytes(addr),
103
- rate,
104
- false,
105
- )
106
- .await
107
- .caused_by(trc::location!())?
108
- .is_some()
+ if !self.is_ip_allowed(addr)
+ && self
+ .core
+ .storage
+ .lookup
+ .is_rate_allowed(
+ KV_RATE_LIMIT_HTTP_ANONYMOUS,
+ &ip_to_bytes(addr),
+ rate,
+ false,
+ )
+ .await
+ .caused_by(trc::location!())?
109
+ .is_some()
110
{
111
return Err(trc::LimitEvent::TooManyRequests.into_err());
112
}
0 commit comments