chore: update linter
This commit is contained in:
parent
1034646ae2
commit
88a2020817
57 changed files with 139 additions and 218 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue