2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 13:47:15 +08:00

feat: 优化对 OpenResty 端口的处理

This commit is contained in:
耗子
2023-11-19 02:10:39 +08:00
parent ff60fb44b7
commit fc9ca25a46
6 changed files with 33 additions and 31 deletions

View File

@@ -221,11 +221,8 @@ func (r *Fail2banController) Add(ctx http.Context) http.Response {
}
var ports string
for _, port := range config.Ports {
if len(strings.Split(port, " ")) > 1 {
ports += strings.Split(port, " ")[0] + ","
} else {
ports += port + ","
}
fields := strings.Fields(cast.ToString(port))
ports += fields[0] + ","
}
rule := `