From 699eabef800ec083175f0723bf7f73e3ca466ef6 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 27 Nov 2024 02:29:08 +0000 Subject: [PATCH] Fix statistics reporting the 5.10 client as web (not just the import script) --- app/blueprints/packages/releases.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/blueprints/packages/releases.py b/app/blueprints/packages/releases.py index d0625c6a..0ef4374d 100644 --- a/app/blueprints/packages/releases.py +++ b/app/blueprints/packages/releases.py @@ -127,7 +127,8 @@ def download_release(package, id): ip = request.headers.get("X-Forwarded-For") or request.remote_addr if ip is not None and not is_user_bot(): - is_minetest = (request.headers.get("User-Agent") or "").startswith("Minetest") + user_agent = request.headers.get("User-Agent") or "" + is_minetest = user_agent.startswith("Luanti") or user_agent.startswith("Minetest") reason = request.args.get("reason") PackageDailyStats.update(package, is_minetest, reason)