Use humanize constants for KiB, MiB and GiB units. (#3322)

This commit is contained in:
Bala FA
2016-11-22 18:18:22 -08:00
committed by Harshavardhana
parent c1ebcbcda2
commit 825000bc34
23 changed files with 170 additions and 135 deletions
+2 -1
View File
@@ -23,6 +23,7 @@ import (
"strings"
"time"
humanize "github.com/dustin/go-humanize"
router "github.com/gorilla/mux"
"github.com/rs/cors"
)
@@ -43,7 +44,7 @@ func registerHandlers(mux *router.Router, handlerFns ...HandlerFunc) http.Handle
// Set the body size limit to 6 Gb = Maximum object size + other possible data
// in the same request
const requestMaxBodySize = 1024 * 1024 * 1024 * (5 + 1)
const requestMaxBodySize = (5 + 1) * humanize.GiByte
type requestSizeLimitHandler struct {
handler http.Handler