Skip to content

Commit

Permalink
[PLT-1263] Add a cookie-csrf-per-request-limit attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
unai-ttxu committed Dec 11, 2024
1 parent d838bd1 commit 8c54e91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cookies/csrf.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func ClearExtraCsrfCookies(opts *options.Cookie, rw http.ResponseWriter, req *ht
}

sort.Slice(decodedCookies, func(i, j int) bool {
return decodedCookies[i].time.Now().Before(decodedCookies[j].time.Now())
return decodedCookies[i].time.Before(decodedCookies[j].time)
})

numberToDelete := len(decodedCookies) - opts.CSRFPerRequestLimit
Expand Down

0 comments on commit 8c54e91

Please sign in to comment.