mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-16 19:35:53 +08:00
Add some sanity check due to webUI
This commit is contained in:
parent
0ceec99c01
commit
d83faee956
@ -22,7 +22,7 @@
|
|||||||
#define _VERSION_ESP3D_H
|
#define _VERSION_ESP3D_H
|
||||||
|
|
||||||
//version and sources location
|
//version and sources location
|
||||||
#define FW_VERSION "3.0.0.a80"
|
#define FW_VERSION "3.0.0.a81"
|
||||||
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
|
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
|
||||||
|
|
||||||
#endif //_VERSION_ESP3D_H
|
#endif //_VERSION_ESP3D_H
|
||||||
|
@ -49,6 +49,12 @@ void HTTP_Server::MKSFileupload ()
|
|||||||
size_t fileSize = 0 ;
|
size_t fileSize = 0 ;
|
||||||
String filename = upload.filename;
|
String filename = upload.filename;
|
||||||
String sfilename = "s"+filename;
|
String sfilename = "s"+filename;
|
||||||
|
//No / in filename
|
||||||
|
int p = filename.lastIndexOf("/");
|
||||||
|
|
||||||
|
if(p!=-1) {
|
||||||
|
filename.remove(0,p+1);
|
||||||
|
}
|
||||||
if (_webserver->hasArg(sfilename)) {
|
if (_webserver->hasArg(sfilename)) {
|
||||||
fileSize = _webserver->arg(sfilename).toInt();
|
fileSize = _webserver->arg(sfilename).toInt();
|
||||||
} else if (_webserver->hasHeader("Content-Length")) {
|
} else if (_webserver->hasHeader("Content-Length")) {
|
||||||
|
@ -408,7 +408,7 @@ void MKSService::messageWiFiControl(const uint8_t * dataFrame, const size_t data
|
|||||||
log_esp3d("WiFi control flag not supported");
|
log_esp3d("WiFi control flag not supported");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Exception handle - but actually not used
|
//Exception handle - but actually not used
|
||||||
void MKSService::messageException(const uint8_t * dataFrame, const size_t dataSize )
|
void MKSService::messageException(const uint8_t * dataFrame, const size_t dataSize )
|
||||||
{
|
{
|
||||||
if(dataSize != 1) {
|
if(dataSize != 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user