From 521a634d2e23f11b82e69e3a7dc3bc7566b66d4e Mon Sep 17 00:00:00 2001 From: axolotlmaid Date: Thu, 26 Sep 2024 17:54:29 +0100 Subject: [PATCH] feat: add httprate to /visitor-counter --- internal/server/router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/server/router.go b/internal/server/router.go index f16ec2b..2caf584 100644 --- a/internal/server/router.go +++ b/internal/server/router.go @@ -33,7 +33,7 @@ func NewRouter() { }) r.Get("/visitor-counter", handler.HandleGetVisitorCounter) - r.Patch("/visitor-counter", handler.HandlePatchVisitorCounter) + r.With(httprate.LimitByRealIP(1, time.Hour)).Patch("/visitor-counter", handler.HandlePatchVisitorCounter) r.Get("/currently-playing", handler.HandleGetCurrentlyPlaying)