From ae6f60ec8983be9b58f37241137ec7ff0f67b30b Mon Sep 17 00:00:00 2001 From: "J. Emrys Landivar" Date: Thu, 9 Dec 2021 14:43:34 -0600 Subject: [PATCH] perf(ingestion): switch from using formvalue to query params (#2640) --- services/httpd/handler.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/httpd/handler.go b/services/httpd/handler.go index daa55cb48..d3f7c057e 100644 --- a/services/httpd/handler.go +++ b/services/httpd/handler.go @@ -462,7 +462,8 @@ func (h *Handler) serveWrite(w http.ResponseWriter, r *http.Request, user auth.U // serveWriteLine receives incoming series data in line protocol format and writes it to the database. func (h *Handler) serveWriteLine(w http.ResponseWriter, r *http.Request, body []byte, user auth.User) { - precision := r.FormValue("precision") + qp := r.URL.Query() + precision := qp.Get("precision") if precision == "" { precision = "n" } @@ -477,7 +478,7 @@ func (h *Handler) serveWriteLine(w http.ResponseWriter, r *http.Request, body [] return } - database := r.FormValue("db") + database := qp.Get("db") if database == "" { h.writeError(w, influxql.Result{Err: fmt.Errorf("database is required")}, http.StatusBadRequest) return @@ -495,7 +496,7 @@ func (h *Handler) serveWriteLine(w http.ResponseWriter, r *http.Request, body [] // Write points. if err := h.PointsWriter.WritePoints( database, - r.FormValue("rp"), + qp.Get("rp"), models.ConsistencyLevelAll, points, ); influxdb.IsClientError(err) {