From 844d9c39c6bc5571b0e5e17cca3774d4c5d46541 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 8 Oct 2024 04:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20UA=20=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../btn/sparkle/module/tracker/TrackerController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ghostchu/btn/sparkle/module/tracker/TrackerController.java b/src/main/java/com/ghostchu/btn/sparkle/module/tracker/TrackerController.java index ac3274e..7cfaf9e 100644 --- a/src/main/java/com/ghostchu/btn/sparkle/module/tracker/TrackerController.java +++ b/src/main/java/com/ghostchu/btn/sparkle/module/tracker/TrackerController.java @@ -178,7 +178,7 @@ public byte[] announce() { }}); } }}; - auditService.log(req, "TRACKER_ANNOUNCE", true, Map.of("hash", infoHash, "user-agent", req.getHeader("User-Agent"))); + auditService.log(req, "TRACKER_ANNOUNCE", true, Map.of("hash", infoHash, "user-agent", ua(req))); return BencodeUtil.INSTANCE.encode(map); } @@ -198,7 +198,7 @@ public ResponseEntity scrape() { } map.put("files", files); map.put("external ip", ip(req)); - auditService.log(req, "TRACKER_SCRAPE", true, Map.of("hash", infoHashes, "user-agent", req.getHeader("User-Agent"))); + auditService.log(req, "TRACKER_SCRAPE", true, Map.of("hash", infoHashes, "user-agent", ua(req))); return ResponseEntity.ok(BencodeUtil.INSTANCE.encode(map)); }