From d2b531f953408573d9657ff285388d97e23352e9 Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Wed, 29 Oct 2025 10:46:39 -0400 Subject: [PATCH] add bot protection --- bin/nexusbot.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/nexusbot.dart b/bin/nexusbot.dart index 21fd264..e36a5be 100644 --- a/bin/nexusbot.dart +++ b/bin/nexusbot.dart @@ -130,11 +130,14 @@ If you have any issues, reply to this email.""", (Router()..post("/", (Request request) async { final settings = container.read(SettingsController.provider)!; try { - final body = await request.readAsString(); + final body = Uri.splitQueryString(await request.readAsString()); + if (body["honeypot"]?.isNotEmpty == true) { + return Response.movedPermanently( + "https://ipv4.games/claim?name=federated.nexus", + ); + } final registration = Registration.fromJson( - Uri.splitQueryString( - body, - ).map((key, value) => MapEntry(key, value.toLowerCase())), + body.map((key, value) => MapEntry(key, value.toLowerCase())), ); final client = await container.read(