cleanup and simplify middleware implementations, refactor some other code

This commit is contained in:
yusing
2024-12-16 10:19:14 +08:00
parent 8a9cb2527e
commit 59f4eaf3ea
34 changed files with 641 additions and 720 deletions

View File

@@ -60,7 +60,7 @@ func checkHost(f http.HandlerFunc) http.HandlerFunc {
}
func rateLimited(f http.HandlerFunc) http.HandlerFunc {
m, err := middleware.RateLimiter.WithOptionsClone(middleware.OptionsRaw{
m, err := middleware.RateLimiter.New(middleware.OptionsRaw{
"average": 10,
"burst": 10,
})