From 4aa503741ffb754b4e7a86d6fd3a3e1a880edf50 Mon Sep 17 00:00:00 2001 From: Luc <8822552+luc-github@users.noreply.github.com> Date: Mon, 11 May 2020 10:13:50 +0200 Subject: [PATCH] Add \n if not present in web commands --- esp3d/src/include/version.h | 2 +- esp3d/src/modules/http/handles/handle-command.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/esp3d/src/include/version.h b/esp3d/src/include/version.h index 5f2de3e5..9ad272fb 100644 --- a/esp3d/src/include/version.h +++ b/esp3d/src/include/version.h @@ -22,7 +22,7 @@ #define _VERSION_ESP3D_H //version and sources location -#define FW_VERSION "3.0.0.a35" +#define FW_VERSION "3.0.0.a36" #define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0" #endif //_VERSION_ESP3D_H diff --git a/esp3d/src/modules/http/handles/handle-command.cpp b/esp3d/src/modules/http/handles/handle-command.cpp index 9800ca61..e44e6b80 100644 --- a/esp3d/src/modules/http/handles/handle-command.cpp +++ b/esp3d/src/modules/http/handles/handle-command.cpp @@ -39,6 +39,7 @@ void HTTP_Server::handle_web_command () if (_webserver->hasArg ("cmd")) { cmd = _webserver->arg ("cmd"); ESP3DOutput output(_webserver); + if(!cmd.endsWith("\n")) cmd+="\n";//need to validate command esp3d_commands.process((uint8_t*)cmd.c_str(), cmd.length(), &output, auth_level); } else { _webserver->send (400, "text/plain", "Invalid command");