Fix statistics reporting the 5.10 client as web (not just the import script)

This commit is contained in:
rubenwardy 2024-11-27 02:29:08 +00:00
parent 73376194e0
commit 699eabef80

@ -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)