1
0
Fork 0

If no key, return JSON blob unchanged

master
Philip O'Toole 1 year ago
parent cba9670c77
commit 2cec05cc80

@ -1,6 +1,7 @@
## 7.20.7 (unreleased)
### Implementation changes and bug fixes
- [PR #1309](https://github.com/rqlite/rqlite/pull/1309): Factor Snapshot creation into own module.
- [PR #1311](https://github.com/rqlite/rqlite/pull/1311): Support 'key' param on /status endpoint.
## 7.20.6 (June 16th 2023)
### Implementation changes and bug fixes

@ -1991,8 +1991,11 @@ func keyParam(req *http.Request) string {
}
func getSubJSON(jsonBlob []byte, keyString string) (json.RawMessage, error) {
keys := strings.Split(keyString, ".")
if keyString == "" {
return jsonBlob, nil
}
keys := strings.Split(keyString, ".")
var obj interface{}
if err := json.Unmarshal(jsonBlob, &obj); err != nil {
return nil, fmt.Errorf("failed to unmarshal json: %w", err)

Loading…
Cancel
Save