fix router errors (#894)
This commit is contained in:
parent
8459ffb690
commit
7b3cb2eb00
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue