From b19e6269c1c56fc4ee72976943f25fc0ffa42c67 Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Tue, 30 Jun 2026 21:53:33 +0100 Subject: [PATCH] Replace chi middleware.Throttle with rest.Throttle on the main router Drop-in swap of the global concurrency limiter (go-pkgz/rest.Throttle has the same signature and semantics as chi's middleware.Throttle), with the chi router left in place. First of the per-middleware swaps that chip away at go-chi/chi/v5/middleware before the router itself is migrated. chi/middleware is still imported for RealIP/Timeout/NoCache; build, vet, race tests and golangci-lint clean. --- backend/app/rest/api/rest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/rest/api/rest.go b/backend/app/rest/api/rest.go index 62323c84..b1a91596 100644 --- a/backend/app/rest/api/rest.go +++ b/backend/app/rest/api/rest.go @@ -221,7 +221,7 @@ func (s *Rest) routes() chi.Router { s.openRouteLimiter = openRouteLimiter } router := chi.NewRouter() - router.Use(middleware.Throttle(1000), middleware.RealIP, R.Recoverer(log.Default())) + router.Use(R.Throttle(1000), middleware.RealIP, R.Recoverer(log.Default())) router.Use(securityHeadersMiddleware(s.ExternalImageProxy, s.AllowedAncestors)) if !s.DisableSignature { router.Use(R.AppInfo("remark42", "umputun", s.Version))