Chore: update gzipping library to use CAFxX/httpcompression (#2741)
* chore: replace nanmu/gzip by CAFxX/httpcompression for compression Instead of using nanmu42/gzip which imports the whole gin framework, we replace it with CAFxX/httpcompression which is more lightweight. Fixes #2697 * Run go mod tidy --------- Co-authored-by: Gabe Kangas <gabek@real-ity.com>
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/nanmu42/gzip"
|
||||
"github.com/CAFxX/httpcompression"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"golang.org/x/net/http2"
|
||||
@@ -419,10 +419,11 @@ func Start() error {
|
||||
}
|
||||
})
|
||||
|
||||
compress, _ := httpcompression.DefaultAdapter() // Use the default configuration
|
||||
server := &http.Server{
|
||||
Addr: fmt.Sprintf("%s:%d", ip, port),
|
||||
ReadHeaderTimeout: 4 * time.Second,
|
||||
Handler: gzip.DefaultHandler().WrapHandler(m),
|
||||
Handler: compress(m),
|
||||
}
|
||||
|
||||
log.Infof("Web server is listening on IP %s port %d.", ip, port)
|
||||
|
||||
Reference in New Issue
Block a user