fix router errors (#894)

This commit is contained in:
Lars Lehtonen 2022-03-29 19:57:54 -07:00 committed by GitHub
parent 8459ffb690
commit 7b3cb2eb00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -142,9 +142,10 @@ func (m *FalconMetric) ToProm() (*prompb.TimeSeries, string, error) {
func falconPush(c *gin.Context) { func falconPush(c *gin.Context) {
var bs []byte var bs []byte
var err error var err error
var r *gzip.Reader
if c.GetHeader("Content-Encoding") == "gzip" { if c.GetHeader("Content-Encoding") == "gzip" {
r, err := gzip.NewReader(c.Request.Body) r, err = gzip.NewReader(c.Request.Body)
if err != nil { if err != nil {
c.String(400, err.Error()) c.String(400, err.Error())
return return

View File

@ -125,9 +125,10 @@ func (m *HTTPMetric) ToProm() (*prompb.TimeSeries, error) {
func handleOpenTSDB(c *gin.Context) { func handleOpenTSDB(c *gin.Context) {
var bs []byte var bs []byte
var err error var err error
var r *gzip.Reader
if c.GetHeader("Content-Encoding") == "gzip" { if c.GetHeader("Content-Encoding") == "gzip" {
r, err := gzip.NewReader(c.Request.Body) r, err = gzip.NewReader(c.Request.Body)
if err != nil { if err != nil {
c.String(400, err.Error()) c.String(400, err.Error())
return return