From 0cfc8c341a367fdf53bb4a1983164246fe4da60c Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 9 Mar 2022 11:10:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8IPv6=E7=9A=84IP=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E8=AE=BF=E9=97=AE=E6=97=A5=E5=BF=97=E6=97=B6=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8E=BB=E6=8E=89[]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/db/models/http_access_log_dao.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/db/models/http_access_log_dao.go b/internal/db/models/http_access_log_dao.go index aedd77af..9e2f1b4e 100644 --- a/internal/db/models/http_access_log_dao.go +++ b/internal/db/models/http_access_log_dao.go @@ -417,6 +417,9 @@ func (this *HTTPAccessLogDAO) listAccessLogs(tx *dbs.Tx, } } } else { + // 去掉IPv6的[] + ip = strings.Trim(ip, "[]") + query.Attr("remoteAddr", ip) query.UseIndex("remoteAddr") }