mirror of https://github.com/hashicorp/consul
Merge pull request #3792 from hashicorp/issue-3791
Fixes crash where body was optional for PQ endpoint (it is not).pull/3793/head
commit
9dd1a70844
|
@ -16,6 +16,7 @@ IMPROVEMENTS:
|
||||||
|
|
||||||
BUG FIXES:
|
BUG FIXES:
|
||||||
|
|
||||||
|
* server: Fixed a crash when POST-ing an empty body to the /v1/query endpoint. [[GH-3791](https://github.com/hashicorp/consul/issues/3791)]
|
||||||
* ui: Added a URI escape around key/value keys so that it's not possible to create unexpected partial key names when entering characters like `?` inside a key. [[GH-3760](https://github.com/hashicorp/consul/issues/3760)]
|
* ui: Added a URI escape around key/value keys so that it's not possible to create unexpected partial key names when entering characters like `?` inside a key. [[GH-3760](https://github.com/hashicorp/consul/issues/3760)]
|
||||||
|
|
||||||
## 1.0.2 (December 15, 2017)
|
## 1.0.2 (December 15, 2017)
|
||||||
|
|
|
@ -22,12 +22,10 @@ func (s *HTTPServer) preparedQueryCreate(resp http.ResponseWriter, req *http.Req
|
||||||
}
|
}
|
||||||
s.parseDC(req, &args.Datacenter)
|
s.parseDC(req, &args.Datacenter)
|
||||||
s.parseToken(req, &args.Token)
|
s.parseToken(req, &args.Token)
|
||||||
if req.ContentLength > 0 {
|
if err := decodeBody(req, &args.Query, nil); err != nil {
|
||||||
if err := decodeBody(req, &args.Query, nil); err != nil {
|
resp.WriteHeader(http.StatusBadRequest)
|
||||||
resp.WriteHeader(http.StatusBadRequest)
|
fmt.Fprintf(resp, "Request decode failed: %v", err)
|
||||||
fmt.Fprintf(resp, "Request decode failed: %v", err)
|
return nil, nil
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var reply string
|
var reply string
|
||||||
|
|
Loading…
Reference in New Issue