1
0
Fork 0

chore: update linter

This commit is contained in:
Ludovic Fernandez 2024-02-19 15:44:03 +01:00 committed by GitHub
parent 1034646ae2
commit 88a2020817
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 139 additions and 218 deletions

View file

@ -3,6 +3,7 @@ package metrics
import (
"context"
"net/http"
"slices"
"strconv"
"strings"
"time"
@ -175,12 +176,10 @@ func isSSERequest(req *http.Request) bool {
func containsHeader(req *http.Request, name, value string) bool {
items := strings.Split(req.Header.Get(name), ",")
for _, item := range items {
if value == strings.ToLower(strings.TrimSpace(item)) {
return true
}
}
return false
return slices.ContainsFunc(items, func(item string) bool {
return value == strings.ToLower(strings.TrimSpace(item))
})
}
// getMethod returns the request's method.