re-enable gzip compression on the legacy handler, as it was supported in influxdb 1.x. Co-authored-by: Cyril Bonté <cyril.bonte@fr.clara.net>pull/23836/head
parent
fa393ccb59
commit
81e2ec617d
|
@ -4,6 +4,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/NYTimes/gziphandler"
|
||||||
"github.com/influxdata/influxdb/v2/http/legacy"
|
"github.com/influxdata/influxdb/v2/http/legacy"
|
||||||
"github.com/influxdata/influxdb/v2/kit/feature"
|
"github.com/influxdata/influxdb/v2/kit/feature"
|
||||||
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
|
@ -45,12 +46,14 @@ func NewPlatformHandler(b *APIBackend, opts ...APIHandlerOptFn) *PlatformHandler
|
||||||
|
|
||||||
legacyBackend := newLegacyBackend(b)
|
legacyBackend := newLegacyBackend(b)
|
||||||
lh := newLegacyHandler(legacyBackend, *legacy.NewHandlerConfig())
|
lh := newLegacyHandler(legacyBackend, *legacy.NewHandlerConfig())
|
||||||
|
// legacy reponses can optionally be gzip encoded
|
||||||
|
gh := gziphandler.GzipHandler(lh)
|
||||||
|
|
||||||
return &PlatformHandler{
|
return &PlatformHandler{
|
||||||
AssetHandler: assetHandler,
|
AssetHandler: assetHandler,
|
||||||
DocsHandler: Redoc("/api/v2/swagger.json"),
|
DocsHandler: Redoc("/api/v2/swagger.json"),
|
||||||
APIHandler: wrappedHandler,
|
APIHandler: wrappedHandler,
|
||||||
LegacyHandler: legacy.NewInflux1xAuthenticationHandler(lh, b.AuthorizerV1, b.HTTPErrorHandler),
|
LegacyHandler: legacy.NewInflux1xAuthenticationHandler(gh, b.AuthorizerV1, b.HTTPErrorHandler),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue