|
|
@ -42,9 +42,13 @@ func registerHandlers(mux *router.Router, handlerFns ...HandlerFunc) http.Handle |
|
|
|
|
|
|
|
|
|
|
|
// Adds limiting body size middleware
|
|
|
|
// Adds limiting body size middleware
|
|
|
|
|
|
|
|
|
|
|
|
// Set the body size limit to 6 Gb = Maximum object size + other possible data
|
|
|
|
// Maximum allowed form data field values. 64MiB is a guessed practical value
|
|
|
|
// in the same request
|
|
|
|
// which is more than enough to accommodate any form data fields and headers.
|
|
|
|
const requestMaxBodySize = (5 + 1) * humanize.GiByte |
|
|
|
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 { |
|
|
|
type requestSizeLimitHandler struct { |
|
|
|
handler http.Handler |
|
|
|
handler http.Handler |
|
|
|