From 622088a97d9112adbb9fa9a1e10a6b2d7e761ffc Mon Sep 17 00:00:00 2001 From: Viktor Patchev Date: Fri, 7 Jan 2022 20:35:56 +0100 Subject: [PATCH] Add http req body limit --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 2968ae7..9afbac3 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,7 @@ import ( "github.com/go-playground/validator/v10" "github.com/joho/godotenv" "github.com/labstack/echo/v4" + "github.com/labstack/echo/v4/middleware" "github.com/sirupsen/logrus" ) @@ -29,7 +30,7 @@ func main() { e.Validator = &lib.CustomValidator{Validator: validator.New()} e.Use(middlewares.ContextDB(db)) - //e.Use(middlewares.IsLoggedIn) + e.Use(middleware.BodyLimit("2M")) routes.Routes(e.Group(""))