replace strings.Split with SplitSeq

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2025-05-31 19:03:41 +02:00
parent 60af36813b
commit b6873768b2
7 changed files with 8 additions and 8 deletions

View File

@@ -731,7 +731,7 @@ func GetRealIP(r *http.Request, header string, depth int) string {
var ipAddresses []string
for _, h := range r.Header.Values(header) {
for _, ipStr := range strings.Split(h, ",") {
for ipStr := range strings.SplitSeq(h, ",") {
ipStr = strings.TrimSpace(ipStr)
ipAddresses = append(ipAddresses, ipStr)
}