Skip to content

Commit

Permalink
标准化 IP 地址 #849
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Jan 3, 2025
1 parent 93a49e3 commit fa7a6e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void recordPeerBan(PeerAddress address, BanMetadata metadata) {
null,
new Timestamp(metadata.getBanAt()),
new Timestamp(metadata.getUnbanAt()),
address.getIp(),
address.getAddress().toNormalizedString(),
address.getPort(),
metadata.getPeer().getId(),
metadata.getPeer().getClientName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void onEnable() {
private void handleInfo(Context ctx) throws SQLException {
// 转换 IP 格式到 PBH 统一内部格式
activeMonitoringModule.flush();
String ip = IPAddressUtil.getIPAddress(ctx.pathParam("ip")).toString();
String ip = IPAddressUtil.getIPAddress(ctx.pathParam("ip")).toNormalizedString();
long banCount = historyDao.queryBuilder()
.where()
.eq("ip", new SelectArg(ip))
Expand Down

0 comments on commit fa7a6e2

Please sign in to comment.