From 5ba1ebd525dd5ba7e3834e544a27ff002a4b49ea Mon Sep 17 00:00:00 2001 From: Christian Schwinne Date: Mon, 24 Oct 2022 18:44:11 +0200 Subject: [PATCH] equals for /presets.json instead of indexof --- wled00/wled_server.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wled00/wled_server.cpp b/wled00/wled_server.cpp index a5301c1a..71040093 100644 --- a/wled00/wled_server.cpp +++ b/wled00/wled_server.cpp @@ -45,14 +45,14 @@ void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t request->_tempFile = WLED_FS.open(finalname, "w"); DEBUG_PRINT("Uploading "); DEBUG_PRINTLN(finalname); - if (finalname.indexOf("presets.json") >= 0) presetsModifiedTime = toki.second(); + if (finalname.equals("/presets.json") >= 0) presetsModifiedTime = toki.second(); } if (len) { request->_tempFile.write(data,len); } if (final) { request->_tempFile.close(); - if (filename.indexOf("cfg.json") >= 0) { + if (filename.indexOf("cfg.json") >= 0) { // check for filename with or without slash doReboot = true; request->send(200, "text/plain", F("Configuration restore successful.\nRebooting...")); } else @@ -618,4 +618,4 @@ void serveSettings(AsyncWebServerRequest* request, bool post) response->addHeader(FPSTR(s_content_enc),"gzip"); setStaticContentCacheHeaders(response); request->send(response); -} \ No newline at end of file +}