From 62fde80490af6d4ab4acee7ce75e098334f37ae3 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 11 Sep 2020 14:42:28 +0300 Subject: [PATCH] lib/protoparser/common: do not read request body when parsing `timestamp` query arg This was preventing from reading data via /api/v1/prometheus/import . Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/750 --- lib/protoparser/common/timestamp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protoparser/common/timestamp.go b/lib/protoparser/common/timestamp.go index 0433f6808..2e51abb91 100644 --- a/lib/protoparser/common/timestamp.go +++ b/lib/protoparser/common/timestamp.go @@ -10,7 +10,7 @@ import ( // // It returns 0 if there is no `timestamp` query arg. func GetTimestamp(req *http.Request) (int64, error) { - ts := req.FormValue("timestamp") + ts := req.URL.Query().Get("timestamp") if len(ts) == 0 { return 0, nil }