From 80596c970f1814656d911ab3efac471beb685c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Jerman?= Date: Thu, 20 Apr 2023 16:08:13 +0200 Subject: [PATCH] Add multopart form parsing to the auth route handlers --- server/auth/handlers/handler.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/auth/handlers/handler.go b/server/auth/handlers/handler.go index da730f9a5..b8e87b702 100644 --- a/server/auth/handlers/handler.go +++ b/server/auth/handlers/handler.go @@ -202,6 +202,12 @@ func (h *AuthHandlers) handle(fn handlerFn) http.HandlerFunc { return } + // Caching 32MB to memory, the rest to disk + err = r.ParseMultipartForm(32 << 20) + if err != nil && err != http.ErrNotMultipart { + return + } + if !validFormPost(r) { req.Status = http.StatusRequestEntityTooLarge return