mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-21 13:57:49 +00:00
self hosted controller JSON format fix for DNS
This commit is contained in:
parent
7d8cfb1fee
commit
ff23d3051f
@ -1031,25 +1031,21 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
|
||||
|
||||
if (b.count("dns")) {
|
||||
json &dns = b["dns"];
|
||||
if (dns.is_array()) {
|
||||
json nda = json::array();
|
||||
for(unsigned int i=0;i<dns.size();++i) {
|
||||
json &d = dns[i];
|
||||
if (d.is_object()) {
|
||||
json nd = json::object();
|
||||
nd["domain"] = d["domain"];
|
||||
json &srv = d["servers"];
|
||||
if (srv.is_array()) {
|
||||
json ns = json::array();
|
||||
for(unsigned int j=0;j<srv.size();++j) {
|
||||
ns.push_back(srv[i]);
|
||||
}
|
||||
nd["servers"] = ns;
|
||||
}
|
||||
nda.push_back(nd);
|
||||
if (dns.is_object()) {
|
||||
json nd;
|
||||
|
||||
nd["domain"] = dns["domain"];
|
||||
|
||||
json &srv = dns["servers"];
|
||||
if (srv.is_array()) {
|
||||
json ns = json::array();
|
||||
for(unsigned int i=0;i<srv.size();++i) {
|
||||
ns.push_back(srv[i]);
|
||||
}
|
||||
nd["servers"] = ns;
|
||||
}
|
||||
network["dns"] = nda;
|
||||
|
||||
network["dns"] = nd;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user