From 5ea72485c169c556a2183d704239d9a2ef86c6e2 Mon Sep 17 00:00:00 2001 From: schakrad <58915923+schakrad@users.noreply.github.com> Date: Fri, 24 Mar 2023 15:01:26 -0400 Subject: [PATCH] feat: extensions.js should respect argocd server enable gzip (#12890) * #11602 fix : Object options menu truncated when selected in ApplicationListView. Signed-off-by: schakradari * extension.js should respect ARGOCD_SERVER_ENABLE_GZIP Signed-off-by: schakrad * reverting the application-resource-list Signed-off-by: schakrad * Update server/server.go Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: schakradari Signed-off-by: schakrad Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --- server/server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index e4d9e80e6a4b4..4f70e415e4d13 100644 --- a/server/server.go +++ b/server/server.go @@ -955,9 +955,13 @@ func (a *ArgoCDServer) newHTTPServer(ctx context.Context, port int, grpcWebHandl // Serve extensions var extensionsSharedPath = "/tmp/extensions/" - mux.HandleFunc("/extensions.js", func(writer http.ResponseWriter, _ *http.Request) { + var extensionsHandler http.Handler = http.HandlerFunc(func(writer http.ResponseWriter, _ *http.Request) { a.serveExtensions(extensionsSharedPath, writer) }) + if a.ArgoCDServerOpts.EnableGZip { + extensionsHandler = compressHandler(extensionsHandler) + } + mux.Handle("/extensions.js", extensionsHandler) // Serve UI static assets var assetsHandler http.Handler = http.HandlerFunc(a.newStaticAssetsHandler())