Enable gzip compression on assets (#1150)

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Daniel Valdivia
2021-10-26 18:20:26 -07:00
committed by GitHub
parent 6f13cbaec1
commit bbe87ecd59
4 changed files with 13 additions and 3 deletions

View File

@@ -31,6 +31,8 @@ import (
"strings"
"time"
"github.com/klauspost/compress/gzhttp"
portal_ui "github.com/minio/console/portal-ui"
"github.com/minio/pkg/mimedb"
@@ -186,7 +188,9 @@ func setupGlobalMiddleware(handler http.Handler) http.Handler {
IsDevelopment: false,
}
secureMiddleware := secure.New(secureOptions)
return RejectS3Middleware(secureMiddleware.Handler(next))
next = secureMiddleware.Handler(next)
gnext := gzhttp.GzipHandler(next)
return RejectS3Middleware(gnext)
}
// RejectS3Middleware will reject requests that have AWS S3 specific headers.