fix: gzip static resources if gzip is enabled (#6279)

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
This commit is contained in:
Alexander Matyushentsev 2021-05-19 22:32:36 -07:00 committed by GitHub
parent b2f547e5ab
commit b57ba42b9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -734,7 +734,11 @@ func (a *ArgoCDServer) newHTTPServer(ctx context.Context, port int, grpcWebHandl
// Serve UI static assets
if a.StaticAssetsDir != "" {
mux.HandleFunc("/", a.newStaticAssetsHandler(a.StaticAssetsDir, a.BaseHRef))
var assetsHandler http.Handler = http.HandlerFunc(a.newStaticAssetsHandler(a.StaticAssetsDir, a.BaseHRef))
if a.ArgoCDServerOpts.EnableGZip {
assetsHandler = compressHandler(assetsHandler)
}
mux.Handle("/", assetsHandler)
}
return &httpS
}