mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
Small fixes.
This commit is contained in:
parent
8718b33a66
commit
4a7ee5472d
1 changed files with 5 additions and 5 deletions
|
@ -415,7 +415,7 @@ unsigned int ControlPlane::handleRequest(
|
||||||
((clusterJson.length() > 0) ? clusterJson.c_str() : "null"));
|
((clusterJson.length() > 0) ? clusterJson.c_str() : "null"));
|
||||||
responseBody = json;
|
responseBody = json;
|
||||||
scode = 200;
|
scode = 200;
|
||||||
} else if (ps[0] == "config") {
|
} else if (ps[0] == "settings") {
|
||||||
responseContentType = "application/json";
|
responseContentType = "application/json";
|
||||||
responseBody = "{}"; // TODO
|
responseBody = "{}"; // TODO
|
||||||
scode = 200;
|
scode = 200;
|
||||||
|
@ -501,7 +501,7 @@ unsigned int ControlPlane::handleRequest(
|
||||||
|
|
||||||
if (isAuth) {
|
if (isAuth) {
|
||||||
|
|
||||||
if (ps[0] == "config") {
|
if (ps[0] == "settings") {
|
||||||
// TODO
|
// TODO
|
||||||
} else if (ps[0] == "network") {
|
} else if (ps[0] == "network") {
|
||||||
if (ps.size() == 2) {
|
if (ps.size() == 2) {
|
||||||
|
@ -517,11 +517,11 @@ unsigned int ControlPlane::handleRequest(
|
||||||
try {
|
try {
|
||||||
nlohmann::json j(nlohmann::json::parse(body));
|
nlohmann::json j(nlohmann::json::parse(body));
|
||||||
if (j.is_object()) {
|
if (j.is_object()) {
|
||||||
auto allowManaged = j["allowManaged"];
|
nlohmann::json &allowManaged = j["allowManaged"];
|
||||||
if (allowManaged.is_boolean()) localSettings.allowManaged = (bool)allowManaged;
|
if (allowManaged.is_boolean()) localSettings.allowManaged = (bool)allowManaged;
|
||||||
auto allowGlobal = j["allowGlobal"];
|
nlohmann::json &allowGlobal = j["allowGlobal"];
|
||||||
if (allowGlobal.is_boolean()) localSettings.allowGlobal = (bool)allowGlobal;
|
if (allowGlobal.is_boolean()) localSettings.allowGlobal = (bool)allowGlobal;
|
||||||
auto allowDefault = j["allowDefault"];
|
nlohmann::json &allowDefault = j["allowDefault"];
|
||||||
if (allowDefault.is_boolean()) localSettings.allowDefault = (bool)allowDefault;
|
if (allowDefault.is_boolean()) localSettings.allowDefault = (bool)allowDefault;
|
||||||
}
|
}
|
||||||
} catch ( ... ) {
|
} catch ( ... ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue