mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-04 18:10:38 +08:00
Typo fixes for webcode error type
Add ping function to check status
This commit is contained in:
parent
f3f44786c0
commit
4124fa9148
@ -34,6 +34,10 @@
|
||||
void HTTP_Server::handle_web_command ()
|
||||
{
|
||||
level_authenticate_type auth_level = AuthenticationService::authenticated_level();
|
||||
if (auth_level == LEVEL_GUEST) {
|
||||
_webserver->send (401, "text/plain", "Wrong authentication!");
|
||||
return;
|
||||
}
|
||||
//log_esp3d("Authentication = %d", auth_level);
|
||||
String cmd = "";
|
||||
if (_webserver->hasArg ("cmd")) {
|
||||
@ -43,7 +47,10 @@ void HTTP_Server::handle_web_command ()
|
||||
cmd+="\n"; //need to validate command
|
||||
}
|
||||
esp3d_commands.process((uint8_t*)cmd.c_str(), cmd.length(), &output, auth_level);
|
||||
} else {
|
||||
} else if (_webserver->hasArg ("ping")) {
|
||||
_webserver->send (200);
|
||||
}
|
||||
else {
|
||||
_webserver->send (400, "text/plain", "Invalid command");
|
||||
}
|
||||
return;
|
||||
|
@ -146,7 +146,7 @@ bool HTTP_Server::StreamSDFile(const char* filename, const char * contentType)
|
||||
}
|
||||
#endif //SD_DEVICE
|
||||
|
||||
void HTTP_Server::pushError(int code, const char * st, bool web_error, uint16_t timeout)
|
||||
void HTTP_Server::pushError(int code, const char * st, uint8_t web_error, uint16_t timeout)
|
||||
{
|
||||
if (websocket_terminal_server.started() && st) {
|
||||
String s = "ERROR:" + String(code) + ":";
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
return _port;
|
||||
}
|
||||
private:
|
||||
static void pushError(int code, const char * st, bool web_error = 500, uint16_t timeout = 1000);
|
||||
static void pushError(int code, const char * st, uint8_t web_error = 500, uint16_t timeout = 1000);
|
||||
static void cancelUpload();
|
||||
static bool _started;
|
||||
static WEBSERVER * _webserver;
|
||||
|
Loading…
x
Reference in New Issue
Block a user