Merge pull request #226 from UAb5eSMn/execute_commands

Support for executing multiple commands via /cmd
This commit is contained in:
logicog
2026-05-18 18:29:55 +02:00
committed by GitHub
5 changed files with 54 additions and 18 deletions
+5 -6
View File
@@ -429,17 +429,16 @@ void handle_post(void)
}
if (is_word(request_path, "cmd")) {
register uint8_t i = 0;
p += 4;
if (!authenticated) {
send_unauthorized();
return;
}
while (*p && *p != '\n' && *p != '\r')
cmd_buffer[i++] = *p++;
cmd_buffer[i] = '\0';
if (i)
cmd_available = 1;
execute_commands(p);
if (err_status != ERR_OK) {
send_bad_request();
return;
}
} else if (is_word(request_path, "login")) {
dbg_string("POST login\n");
p += 8; // Read also over "pwd="