From 859535e7b8806da5d7d571b597febc4c5d2dd9ce Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 30 Dec 2018 13:49:23 +0100 Subject: [PATCH] Enable gzip compression on assets Signed-off-by: Knut Ahlers --- cmdServe.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmdServe.go b/cmdServe.go index 7a03ca2..7b07b64 100644 --- a/cmdServe.go +++ b/cmdServe.go @@ -11,6 +11,7 @@ import ( "github.com/gorilla/mux" "github.com/spf13/cobra" + http_helper "github.com/Luzifer/go_helpers/http" pwd "github.com/Luzifer/password/lib" ) @@ -29,7 +30,7 @@ func getCmdServe() *cobra.Command { func actionCmdServe(cmd *cobra.Command, args []string) { r := mux.NewRouter() r.HandleFunc("/", handleFrontend).Methods("GET") - r.PathPrefix("/assets").HandlerFunc(handleAssets).Methods("GET") + r.PathPrefix("/assets").HandlerFunc(http_helper.GzipFunc(handleAssets)).Methods("GET") r.HandleFunc("/v1/getPassword", handleAPIGetPasswordv1).Methods("GET") http.Handle("/", r)