Commit b03679c6 authored by PhiBo's avatar PhiBo 🚀

Return also empty api hostname

parent d3ec7d1d
......@@ -8,12 +8,8 @@ void handleAPIHostname()
String hostname_s;
if (server->method() == HTTP_GET) {
len = getAPIHostname(&hostname[0], NODE_EEPROM_API_HOSTNAME_MAX_LENGTH);
if(len > 0) {
hostname[NODE_EEPROM_API_HOSTNAME_MAX_LENGTH] = '\0';
server->send(200, "text/plain", hostname);
} else {
server->send(404, "text/plain", "Hostname not set");
}
hostname[NODE_EEPROM_API_HOSTNAME_MAX_LENGTH] = '\0';
server->send(200, "text/plain", hostname);
} else if (server->method() == HTTP_POST) {
if(server->args() == 0) {
server->send(400, "text/plain", "No argument given");
......@@ -25,7 +21,6 @@ void handleAPIHostname()
setAPIHostname(hostname, hostname_s.length());
server->send(200, "text/plain", "Password set");
}
}
void handleAPIPort()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment