@@ -12,7 +12,6 @@ import (
1212 "path"
1313 "time"
1414
15- "github.com/NYTimes/gziphandler"
1615 "github.com/prometheus/client_golang/prometheus"
1716 "github.com/rs/cors"
1817 "go.uber.org/zap"
@@ -117,11 +116,10 @@ func New(
117116 }
118117
119118 router := newRouter ()
120- handler := wrapHandler (router , nodeID , allowedOrigins , allowedHosts , true )
119+ handler := wrapHandler (router , nodeID , allowedOrigins , allowedHosts )
121120
122121 http2Router := newHTTP2Router ()
123- // Do not use gzip middleware because it breaks the grpc spec
124- http2Handler := wrapHandler (http2Router , nodeID , allowedOrigins , allowedHosts , false )
122+ http2Handler := wrapHandler (http2Router , nodeID , allowedOrigins , allowedHosts )
125123
126124 httpServer := & http.Server {
127125 Handler : h2c .NewHandler (
@@ -333,16 +331,12 @@ func wrapHandler(
333331 nodeID ids.NodeID ,
334332 allowedOrigins []string ,
335333 allowedHosts []string ,
336- gzip bool ,
337334) http.Handler {
338335 h := filterInvalidHosts (handler , allowedHosts )
339336 h = cors .New (cors.Options {
340337 AllowedOrigins : allowedOrigins ,
341338 AllowCredentials : true ,
342339 }).Handler (h )
343- if gzip {
344- h = gziphandler .GzipHandler (h )
345- }
346340 return http .HandlerFunc (
347341 func (w http.ResponseWriter , r * http.Request ) {
348342 // Attach this node's ID as a header
0 commit comments