[MM-64654] Migrate to modern Go features (#31820)

This commit is contained in:
Ben Schumacher
2025-07-18 12:54:51 +02:00
committed by GitHub
parent ae35dd93a9
commit 9add320011
222 changed files with 692 additions and 925 deletions
@@ -6,6 +6,7 @@ package httpservice
import (
"net"
"net/http"
"slices"
"strings"
"time"
"unicode"
@@ -80,12 +81,7 @@ func (h *HTTPServiceImpl) MakeTransport(trustURLs bool) *MattermostTransport {
if h.configService.Config().ServiceSettings.AllowedUntrustedInternalConnections == nil {
return false
}
for _, allowed := range strings.FieldsFunc(*h.configService.Config().ServiceSettings.AllowedUntrustedInternalConnections, splitFields) {
if host == allowed {
return true
}
}
return false
return slices.Contains(strings.FieldsFunc(*h.configService.Config().ServiceSettings.AllowedUntrustedInternalConnections, splitFields), host)
}
allowIP := func(ip net.IP) bool {