mirror of
https://github.com/fleetdm/fleet
synced 2026-05-06 06:48:54 +00:00
Use newer/maintained gzip handler (#25664)
For #24732. No changes file as previous PR includes the changes file we need and we're treating using the older library as an unreleased bug. # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] A detailed QA plan exists on the associated ticket (if it isn't there, work with the product group's QA engineer to add it) - [x] Manual QA for all new/changed functionality
This commit is contained in:
parent
ee54c67187
commit
ac656f63ac
3 changed files with 5 additions and 4 deletions
3
go.mod
3
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
|
||||
|
|
|
|||
2
go.sum
2
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=
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue