mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-05-09 20:12:50 +00:00
Fix unstable network member list endpoint
It was returning an array of array instead of just array
This commit is contained in:
parent
559e8a907b
commit
6e8fcce777
@ -1094,12 +1094,8 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
|
|||||||
|
|
||||||
auto out = nlohmann::json::object();
|
auto out = nlohmann::json::object();
|
||||||
auto meta = nlohmann::json::object();
|
auto meta = nlohmann::json::object();
|
||||||
auto members = nlohmann::json::array();
|
|
||||||
std::vector<json> memTmp;
|
std::vector<json> memTmp;
|
||||||
if (_db.get(nwid, network, memTmp)) {
|
if (_db.get(nwid, network, memTmp)) {
|
||||||
members.push_back(memTmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t authorizedCount = 0;
|
uint64_t authorizedCount = 0;
|
||||||
uint64_t totalCount = memTmp.size();
|
uint64_t totalCount = memTmp.size();
|
||||||
for (auto m = memTmp.begin(); m != memTmp.end(); ++m) {
|
for (auto m = memTmp.begin(); m != memTmp.end(); ++m) {
|
||||||
@ -1110,10 +1106,14 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
|
|||||||
meta["totalCount"] = totalCount;
|
meta["totalCount"] = totalCount;
|
||||||
meta["authorizedCount"] = authorizedCount;
|
meta["authorizedCount"] = authorizedCount;
|
||||||
|
|
||||||
out["data"] = members;
|
out["data"] = memTmp;
|
||||||
out["meta"] = meta;
|
out["meta"] = meta;
|
||||||
|
|
||||||
setContent(req, res, out.dump());
|
setContent(req, res, out.dump());
|
||||||
|
} else {
|
||||||
|
res.status = 404;
|
||||||
|
return;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
s.Get(memberListPath2, memberListGet2);
|
s.Get(memberListPath2, memberListGet2);
|
||||||
sv6.Get(memberListPath2, memberListGet2);
|
sv6.Get(memberListPath2, memberListGet2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user