Skip to content

Commit

Permalink
修复 UA 可能为空的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Oct 7, 2024
1 parent 03406b0 commit 844d9c3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -198,7 +198,7 @@ public ResponseEntity<byte[]> 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));
}

Expand Down

0 comments on commit 844d9c3

Please sign in to comment.