diff --git a/cmd/generic-handlers.go b/cmd/generic-handlers.go index a84f9c66e..b657edeca 100644 --- a/cmd/generic-handlers.go +++ b/cmd/generic-handlers.go @@ -42,9 +42,13 @@ func registerHandlers(mux *router.Router, handlerFns ...HandlerFunc) http.Handle // Adds limiting body size middleware -// Set the body size limit to 6 Gb = Maximum object size + other possible data -// in the same request -const requestMaxBodySize = (5 + 1) * humanize.GiByte +// Maximum allowed form data field values. 64MiB is a guessed practical value +// which is more than enough to accommodate any form data fields and headers. +const requestFormDataSize = 64 * humanize.MiByte + +// For any HTTP request, request body should be not more than 5GiB + requestFormDataSize +// where, 5GiB is the maximum allowed object size for object upload. +const requestMaxBodySize = 5*humanize.GiByte + requestFormDataSize type requestSizeLimitHandler struct { handler http.Handler