]> git.ipfire.org Git - pbs.git/commitdiff
mirrors: Limit for up to 100 requests per hour for downloads
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Feb 2025 15:28:19 +0000 (15:28 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Feb 2025 15:28:19 +0000 (15:28 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/web/mirrors.py

index 2ec5202875d519b36a44102d4c18b82e0b2bef8d..219515a77c49603e7d093efda951397e65ecc7cc 100644 (file)
@@ -133,6 +133,7 @@ class DownloadsHandler(base.BaseHandler):
 
                As a last resort, we will try to serve the file locally.
        """
+       @base.ratelimit(limit=100, minutes=60, key="downloads")
        async def get(self, path):
                # Fetch all mirrors for this client
                mirrors = await self.backend.mirrors.get_mirrors_for_address(self.current_address)