Merge pull request #6163 from influxdata/jl-content-type
Don't use Request.FormValue() in HTTP handlerpull/6160/head
commit
de94acc79d
|
@ -28,6 +28,7 @@
|
|||
- [#5554](https://github.com/influxdata/influxdb/issues/5554): Can't run in alpine linux
|
||||
- [#6094](https://github.com/influxdata/influxdb/issues/6094): Ensure CREATE RETENTION POLICY and CREATE CONTINUOUS QUERY are idempotent in the correct way.
|
||||
- [#6092](https://github.com/influxdata/influxdb/issues/6092): Upgrading directly from 0.9.6.1 to 0.11.0 fails
|
||||
- [#6061](https://github.com/influxdata/influxdb/issues/6061): [0.12 / master] POST to /write does not write points if request has header 'Content-Type: application/x-www-form-urlencoded'
|
||||
|
||||
## v0.11.0 [2016-03-22]
|
||||
|
||||
|
|
|
@ -384,7 +384,7 @@ func (h *Handler) serveWrite(w http.ResponseWriter, r *http.Request, user *meta.
|
|||
h.statMap.Add(statWriteRequestDuration, time.Since(start).Nanoseconds())
|
||||
}(time.Now())
|
||||
|
||||
database := r.FormValue("db")
|
||||
database := r.URL.Query().Get("db")
|
||||
if database == "" {
|
||||
resultError(w, influxql.Result{Err: fmt.Errorf("database is required")}, http.StatusBadRequest)
|
||||
return
|
||||
|
@ -444,7 +444,7 @@ func (h *Handler) serveWrite(w http.ResponseWriter, r *http.Request, user *meta.
|
|||
h.Logger.Printf("write body received by handler: %s", buf.Bytes())
|
||||
}
|
||||
|
||||
points, parseError := models.ParsePointsWithPrecision(buf.Bytes(), time.Now().UTC(), r.FormValue("precision"))
|
||||
points, parseError := models.ParsePointsWithPrecision(buf.Bytes(), time.Now().UTC(), r.URL.Query().Get("precision"))
|
||||
// Not points parsed correctly so return the error now
|
||||
if parseError != nil && len(points) == 0 {
|
||||
if parseError.Error() == "EOF" {
|
||||
|
@ -456,7 +456,7 @@ func (h *Handler) serveWrite(w http.ResponseWriter, r *http.Request, user *meta.
|
|||
}
|
||||
|
||||
// Write points.
|
||||
if err := h.PointsWriter.WritePoints(database, r.FormValue("rp"), models.ConsistencyLevelAny, points); influxdb.IsClientError(err) {
|
||||
if err := h.PointsWriter.WritePoints(database, r.URL.Query().Get("rp"), models.ConsistencyLevelAny, points); influxdb.IsClientError(err) {
|
||||
h.statMap.Add(statPointsWrittenFail, int64(len(points)))
|
||||
resultError(w, influxql.Result{Err: err}, http.StatusBadRequest)
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue