diff options
| author | rubenwardy <rw@rubenwardy.com> | 2020-07-16 14:35:12 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2020-07-16 14:35:12 +0100 |
| commit | 74371d3fcb6731726564f554956f62ff29cab067 (patch) | |
| tree | 98ea198bd563e203888722aa2421f7f7b55d1770 /app/blueprints | |
| parent | 9d3ba8991d2d0ed249398e5bfdb055d566ff9df4 (diff) | |
| download | cheatdb-74371d3fcb6731726564f554956f62ff29cab067.tar.xz | |
Check user-agent for crawlers before incrementing counters
Diffstat (limited to 'app/blueprints')
| -rw-r--r-- | app/blueprints/packages/packages.py | 2 | ||||
| -rw-r--r-- | app/blueprints/packages/releases.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/blueprints/packages/packages.py b/app/blueprints/packages/packages.py index bacbbe1..716e79e 100644 --- a/app/blueprints/packages/packages.py +++ b/app/blueprints/packages/packages.py @@ -53,7 +53,7 @@ def list_all(): subqueryload(Package.tags)) ip = request.headers.get("X-Forwarded-For") or request.remote_addr - if ip is not None: + if ip is not None and not is_user_bot(): edited = False for tag in qb.tags: edited = True diff --git a/app/blueprints/packages/releases.py b/app/blueprints/packages/releases.py index 1d11477..278f9aa 100644 --- a/app/blueprints/packages/releases.py +++ b/app/blueprints/packages/releases.py @@ -130,7 +130,7 @@ def download_release(package, id): abort(404) ip = request.headers.get("X-Forwarded-For") or request.remote_addr - if ip is not None: + if ip is not None and not is_user_bot(): key = make_download_key(ip, release.package) if not has_key(key): set_key(key, "true") |
