Add missing self.

master
micw 5 years ago committed by GitHub
parent 70f797dbd9
commit 7688caa784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,13 +24,13 @@ class Limiter:
def check(self,clientip): def check(self,clientip):
# disable limits for internal requests (e.g. from webmail)? # disable limits for internal requests (e.g. from webmail)?
if rate_limit_subnet==False and ipaddress.ip_address(clientip) in self.subnet: if self.rate_limit_subnet==False and ipaddress.ip_address(clientip) in self.subnet:
return return
if not self.limiter.test(self.rate,"client-ip",clientip): if not self.limiter.test(self.rate,"client-ip",clientip):
raise RateLimitExceeded() raise RateLimitExceeded()
def hit(self,clientip): def hit(self,clientip):
# disable limits for internal requests (e.g. from webmail)? # disable limits for internal requests (e.g. from webmail)?
if rate_limit_subnet==False and ipaddress.ip_address(clientip) in self.subnet: if self.rate_limit_subnet==False and ipaddress.ip_address(clientip) in self.subnet:
return return
self.limiter.hit(self.rate,"client-ip",clientip) self.limiter.hit(self.rate,"client-ip",clientip)

Loading…
Cancel
Save