Merge pull request #2115 from zerotier/gh-2114

fix for issue #2114
This commit is contained in:
Grant Limberg 2023-08-28 08:50:36 -07:00 committed by GitHub
commit 72533cbd13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -997,16 +997,14 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
return;
}
json out = json::array();
json out = json::object();
std::vector<json> memTmp;
if (_db.get(nwid, network, memTmp)) {
for (auto m = memTmp.begin(); m != memTmp.end(); ++m) {
int revision = OSUtils::jsonInt((*m)["revision"], 0);
std::string id = OSUtils::jsonString((*m)["id"], "");
if (id.length() == 10) {
json tmp = json::object();
tmp[id] = revision;
out.push_back(tmp);
out[id] = revision;
}
}
}