From 810218124eae91432f4fa3eab54476fdf3d2d252 Mon Sep 17 00:00:00 2001 From: allanice001 Date: Tue, 6 Jan 2026 10:11:42 +0000 Subject: [PATCH] revert, but increase httprate --- internal/api/routes.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/api/routes.go b/internal/api/routes.go index 575109e..499e9ac 100644 --- a/internal/api/routes.go +++ b/internal/api/routes.go @@ -16,6 +16,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" "github.com/go-chi/cors" + "github.com/go-chi/httprate" "gorm.io/gorm" @@ -36,6 +37,7 @@ func NewRouter(db *gorm.DB, jobs *bg.Jobs, studio http.Handler) http.Handler { r.Use(middleware.Recoverer) r.Use(SecurityHeaders) r.Use(requestBodyLimit(10 << 20)) + r.Use(httprate.LimitByIP(1000, 1*time.Minute)) r.Use(middleware.StripSlashes) allowed := getAllowedOrigins()