tests(web): verify compressed files are not re-compressed
the test file used has a size below the default threshold and will never be compressed because of that, regardless of its extension. Reduce the threshold to 10 bytes otherwise the test is a false positive.
This commit is contained in:
parent
bd32dedb48
commit
a05eb66c99
2 changed files with 5 additions and 1 deletions
|
@ -57,6 +57,8 @@ import (
|
|||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
var GzipMinSize = gzhttp.DefaultMinSize
|
||||
|
||||
// optionsCorsHandler return a http handler which sets CORS options if enabled by config, it blocks non-CORS OPTIONS requests.
|
||||
func optionsCorsHandler() func(next http.Handler) http.Handler {
|
||||
var corsHandler func(next http.Handler) http.Handler
|
||||
|
@ -242,7 +244,7 @@ func Routes() *web.Route {
|
|||
var mid []any
|
||||
|
||||
if setting.EnableGzip {
|
||||
wrapper, err := gzhttp.NewWrapper(gzhttp.RandomJitter(32, 0, false))
|
||||
wrapper, err := gzhttp.NewWrapper(gzhttp.RandomJitter(32, 0, false), gzhttp.MinSize(GzipMinSize))
|
||||
if err != nil {
|
||||
log.Fatal("gzhttp.NewWrapper failed: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue