From ad05e3de6e774405a967a6dd348a467d0613c21e Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 28 Jul 2021 17:09:43 +0100 Subject: [PATCH] Clean up a bit --- clientapi/routing/keys.go | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/clientapi/routing/keys.go b/clientapi/routing/keys.go index f7cd8a26..8b8fcc27 100644 --- a/clientapi/routing/keys.go +++ b/clientapi/routing/keys.go @@ -112,22 +112,15 @@ func QueryKeys(req *http.Request, keyAPI api.KeyInternalAPI) util.JSONResponse { Timeout: r.GetTimeout(), // TODO: Token? }, &queryRes) - res := map[string]interface{}{ - "device_keys": queryRes.DeviceKeys, - "failures": queryRes.Failures, - } - if k := queryRes.MasterKeys; k != nil { - res["master_keys"] = k - } - if k := queryRes.SelfSigningKeys; k != nil { - res["self_signing_keys"] = k - } - if k := queryRes.UserSigningKeys; k != nil { - res["user_signing_keys"] = k - } return util.JSONResponse{ Code: 200, - JSON: res, + JSON: map[string]interface{}{ + "device_keys": queryRes.DeviceKeys, + "master_keys": queryRes.MasterKeys, + "self_signing_keys": queryRes.SelfSigningKeys, + "user_signing_keys": queryRes.UserSigningKeys, + "failures": queryRes.Failures, + }, } }