Skip to content

Commit

Permalink
fix(httpd): abort processing write request when encountering a precis…
Browse files Browse the repository at this point in the history
…ion error (influxdata#21746)
  • Loading branch information
StoneYunZhao authored and chengshiwen committed Aug 11, 2024
1 parent 043fb73 commit 199422b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion services/httpd/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ func (h *Handler) async(q *influxql.Query, results <-chan *query.Result) {
// bucket2drbp extracts a bucket and retention policy from a properly formatted
// string.
//
// The 2.x compatible endpoints encode the databse and retention policy names
// The 2.x compatible endpoints encode the database and retention policy names
// in the database URL query value. It is encoded using a forward slash like
// "database/retentionpolicy" and we should be able to simply split that string
// on the forward slash.
Expand Down Expand Up @@ -853,6 +853,7 @@ func (h *Handler) serveWriteV2(w http.ResponseWriter, r *http.Request, user meta
default:
err := fmt.Sprintf("invalid precision %q (use ns, us, ms or s)", precision)
h.httpError(w, err, http.StatusBadRequest)
return
}

db, rp, err := bucket2dbrp(r.URL.Query().Get("bucket"))
Expand All @@ -872,6 +873,7 @@ func (h *Handler) serveWriteV1(w http.ResponseWriter, r *http.Request, user meta
default:
err := fmt.Sprintf("invalid precision %q (use n, u, ms, s, m or h)", precision)
h.httpError(w, err, http.StatusBadRequest)
return
}

db := r.URL.Query().Get("db")
Expand Down

0 comments on commit 199422b

Please sign in to comment.