From bee80b5c64951747096c09ab68707bf764e50b56 Mon Sep 17 00:00:00 2001 From: Michael Wyraz Date: Fri, 6 Dec 2019 11:02:21 +0100 Subject: [PATCH] Remove rate limit reset --- core/admin/mailu/internal/views/auth.py | 4 +--- core/admin/mailu/limiter.py | 8 -------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/core/admin/mailu/internal/views/auth.py b/core/admin/mailu/internal/views/auth.py index af1c552f..b1f37d17 100644 --- a/core/admin/mailu/internal/views/auth.py +++ b/core/admin/mailu/internal/views/auth.py @@ -17,9 +17,7 @@ def nginx_authentication(): response = flask.Response() for key, value in headers.items(): response.headers[key] = str(value) - if ("Auth-Status" in headers) and (headers["Auth-Status"]=="OK"): - utils.limiter.reset(flask.request.headers["Client-Ip"]) - else: + if ("Auth-Status" not in headers) or (headers["Auth-Status"]!="OK"): utils.limiter.hit(flask.request.headers["Client-Ip"]) return response diff --git a/core/admin/mailu/limiter.py b/core/admin/mailu/limiter.py index 4df78d27..fd0b138b 100644 --- a/core/admin/mailu/limiter.py +++ b/core/admin/mailu/limiter.py @@ -35,11 +35,3 @@ class Limiter: # return if not self.limiter.hit(self.rate,"client-ip",clientip): raise RateLimitExceeded() - - def reset(self,clientip): - # TODO: activate this code if we have limits at webmail level - #if ipaddress.ip_address(clientip) in self.subnet: - # # no limits for internal requests (e.g. from webmail) - # return - # limit reset is not supported by the rate limit library - pass