Skip to content

Commit

Permalink
h2non#422 Make some changes based on the docker golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
EyePulp committed Jan 26, 2024
1 parent c5abb4a commit d733959
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ func throttle(next http.Handler, o ServerOptions) http.Handler {
}

quota := throttled.RateQuota{MaxRate: throttled.PerSec(o.Concurrency), MaxBurst: o.Burst}
rateLimiter, err := throttled.NewGCRARateLimiter(store, quota)
rateLimiter, err := throttled.NewGCRARateLimiterCtx(throttled.WrapStoreWithContext(store), quota)
if err != nil {
return throttleError(err)
}

httpRateLimiter := throttled.HTTPRateLimiter{
httpRateLimiter := throttled.HTTPRateLimiterCtx{
RateLimiter: rateLimiter,
VaryBy: &throttled.VaryBy{Method: true},
}
Expand Down Expand Up @@ -138,7 +138,7 @@ func defaultHeaders(next http.Handler) http.Handler {

func insensitiveArrayContains(haystack []string, needle string) bool {
for _, value := range haystack {
if strings.ToLower(value) == strings.ToLower(needle) {
if strings.EqualFold(value, needle) {
return true
}
}
Expand Down

0 comments on commit d733959

Please sign in to comment.