Skip to content

Commit

Permalink
perf(ingestion): switch from using formvalue to query params (#2640)
Browse files Browse the repository at this point in the history
  • Loading branch information
docmerlin authored Dec 9, 2021
1 parent e5b44d0 commit ae6f60e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions services/httpd/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit ae6f60e

Please sign in to comment.