diff --git a/go.mod b/go.mod index fd0e1acec5..30d8fe449f 100644 --- a/go.mod +++ b/go.mod @@ -66,7 +66,7 @@ require ( github.com/jmoiron/sqlx v1.3.5 github.com/josephspurrier/goversioninfo v1.4.0 github.com/kevinburke/go-bindata v3.24.0+incompatible - github.com/klauspost/compress v1.17.9 + github.com/klauspost/compress v1.17.11 github.com/kolide/launcher v1.0.12 github.com/lib/pq v1.10.9 github.com/macadmins/osquery-extension v1.2.3 @@ -158,7 +158,6 @@ require ( github.com/Masterminds/semver/v3 v3.1.1 // indirect github.com/Masterminds/sprig v2.22.0+incompatible // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/OneOfOne/xxhash v1.2.8 // indirect github.com/ProtonMail/go-crypto v1.1.3 // indirect github.com/agnivade/levenshtein v1.1.1 // indirect diff --git a/go.sum b/go.sum index 8a37312c55..059124c211 100644 --- a/go.sum +++ b/go.sum @@ -531,6 +531,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kolide/kit v0.0.0-20221107170827-fb85e3d59eab h1:KVR7cs+oPyy85i+8t1ZaNSy1bymCy5FuWyt51pdrXu4= github.com/kolide/kit v0.0.0-20221107170827-fb85e3d59eab/go.mod h1:OYYulo9tUqRadRLwB0+LE914sa1ui2yL7OrcU3Q/1XY= github.com/kolide/launcher v1.0.12 h1:f2uT1kKYGIbj/WVsHDc10f7MIiwu8MpmgwaGaT7D09k= diff --git a/server/service/frontend.go b/server/service/frontend.go index 8b80712048..b499606d3e 100644 --- a/server/service/frontend.go +++ b/server/service/frontend.go @@ -7,11 +7,11 @@ import ( "net/http" "net/url" - "github.com/NYTimes/gziphandler" assetfs "github.com/elazarl/go-bindata-assetfs" "github.com/fleetdm/fleet/v4/server/bindata" "github.com/fleetdm/fleet/v4/server/fleet" "github.com/go-kit/log" + "github.com/klauspost/compress/gzhttp" ) func newBinaryFileSystem(root string) *assetfs.AssetFS { @@ -149,7 +149,7 @@ func ServeStaticAssets(path string) http.Handler { contentTypes := []string{"text/javascript", "text/css"} withoutGzip := http.StripPrefix(path, http.FileServer(newBinaryFileSystem("/assets"))) - withOpts, err := gziphandler.GzipHandlerWithOpts(gziphandler.ContentTypes(contentTypes)) + withOpts, err := gzhttp.NewWrapper(gzhttp.ContentTypes(contentTypes)) if err != nil { // fall back to serving without gzip if serving with gzip somehow fails return withoutGzip }