Skip to content

Commit 693f31f

Browse files
committed
Add sanity check in case no path
1 parent 12c30f2 commit 693f31f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

esp3d/src/modules/http/handlers/handle-SD-files.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ void HTTP_Server::handleSDFileList() {
7575

7676
// get current path
7777
if (_webserver->hasArg("path")) {
78-
path += _webserver->arg("path");
78+
path = _webserver->arg("path");
79+
} else {
80+
path = "/";
7981
}
8082
// to have a clean path
8183
path.trim();

esp3d/src/modules/http/handlers/handle-files.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ void HTTP_Server::handleFSFileList() {
6363
}
6464
// get current path
6565
if (_webserver->hasArg("path")) {
66-
path += _webserver->arg("path");
66+
path = _webserver->arg("path");
67+
} else {
68+
path = "/";
6769
}
6870
// to have a clean path
6971
path.trim();

0 commit comments

Comments
 (0)