From e21ec2e81cdfd439aea9068a3355cc6a67af420e Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 30 Mar 2025 22:58:02 +0800 Subject: [PATCH] :bug: Fix wrong route for rate limiter --- pkg/internal/web/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/internal/web/server.go b/pkg/internal/web/server.go index 795779e..c86a125 100644 --- a/pkg/internal/web/server.go +++ b/pkg/internal/web/server.go @@ -63,7 +63,7 @@ func NewServer() *WebApp { Expiration: 60 * time.Second, LimiterMiddleware: limiter.SlidingWindow{}, Next: func(c *fiber.Ctx) bool { - return lo.Contains([]string{"GET", "HEAD", "OPTIONS", "CONNECT", "TRACE"}, c.Method()) + return lo.Contains([]string{"POST", "PUT", "DELETE", "PATCH"}, c.Method()) }, })) app.Use(limiter.New(limiter.Config{ @@ -71,7 +71,7 @@ func NewServer() *WebApp { Expiration: 60 * time.Second, LimiterMiddleware: limiter.SlidingWindow{}, Next: func(c *fiber.Ctx) bool { - return lo.Contains([]string{"POST", "PUT", "DELETE", "PATCH"}, c.Method()) + return lo.Contains([]string{"GET", "HEAD", "OPTIONS", "CONNECT", "TRACE"}, c.Method()) }, }))