diff --git a/src/WebServer.cpp b/src/WebServer.cpp index 0d1e409..a0443ca 100644 --- a/src/WebServer.cpp +++ b/src/WebServer.cpp @@ -21,6 +21,11 @@ WebServer::WebServer(void) bool WebServer::serveFile(String filename, httpsserver::HTTPResponse *res) { uint8_t buf[1024]; + + if(!SPIFFS.exists(filename)) { + return false; + } + File f = SPIFFS.open(filename.c_str(), "r"); if(!f) { @@ -149,9 +154,11 @@ void WebServer::handleListAnim(httpsserver::HTTPRequest *req, httpsserver::HTTPR res->print("["); for(size_t i = 0; i < AnimationController::AnimationNames.size(); i++) { - res->print("{\"id\": "); + res->print("{\"id\":"); res->print(i); - res->print("}"); + res->print(",\"name\":\""); + res->print(AnimationController::AnimationNames[i]); + res->print("\"}"); if(i < AnimationController::AnimationNames.size()-1) { res->print(",");