Skip to content

Commit

Permalink
Fix zero limit
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVitek committed Aug 23, 2024
1 parent 99b3b69 commit b5ad922
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (l *rateLimiter) Handler(next http.Handler) http.Handler {
ctx := r.Context()

limit := l.requestLimit
if val := getRequestLimit(ctx); val > 0 {
if val, ok := getRequestLimit(ctx); ok {

Check failure on line 89 in limiter.go

View workflow job for this annotation

GitHub Actions / Tests

assignment mismatch: 2 variables but getRequestLimit returns 1 value
limit = val
}
setHeader(w, l.headers.Limit, fmt.Sprintf("%d", limit))
Expand Down

0 comments on commit b5ad922

Please sign in to comment.