From e45845e00ece6f27c64985e0238cbb74ce352dee Mon Sep 17 00:00:00 2001 From: Mimoja Date: Mon, 19 Jun 2023 16:38:19 +0200 Subject: [PATCH] Add SPIFFSEditor header to match imported source file The SPIFFSEditor.h header is being imported from the .platformio folder while the corresponding .cpp is actually stored with the project. To ensure we can not accidentally edit the wrong file in the future import the header as well Signed-off-by: Mimoja --- ESP32_AP-Flasher/include/SPIFFSEditor.h | 24 ++++++++++++++++++++++++ ESP32_AP-Flasher/src/web.cpp | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 ESP32_AP-Flasher/include/SPIFFSEditor.h diff --git a/ESP32_AP-Flasher/include/SPIFFSEditor.h b/ESP32_AP-Flasher/include/SPIFFSEditor.h new file mode 100644 index 00000000..3586429e --- /dev/null +++ b/ESP32_AP-Flasher/include/SPIFFSEditor.h @@ -0,0 +1,24 @@ +#ifndef SPIFFSEditor_H_ +#define SPIFFSEditor_H_ +#include + +class SPIFFSEditor: public AsyncWebHandler { + private: + fs::FS _fs; + String _username; + String _password; + bool _authenticated; + uint32_t _startTime; + public: +#ifdef ESP32 + SPIFFSEditor(const fs::FS& fs, const String& username=String(), const String& password=String()); +#else + SPIFFSEditor(const String& username=String(), const String& password=String(), const fs::FS& fs=SPIFFS); +#endif + virtual bool canHandle(AsyncWebServerRequest *request) override final; + virtual void handleRequest(AsyncWebServerRequest *request) override final; + virtual void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final) override final; + virtual bool isRequestHandlerTrivial() override final {return false;} +}; + +#endif diff --git a/ESP32_AP-Flasher/src/web.cpp b/ESP32_AP-Flasher/src/web.cpp index cff410b4..fe9e06d1 100644 --- a/ESP32_AP-Flasher/src/web.cpp +++ b/ESP32_AP-Flasher/src/web.cpp @@ -8,7 +8,7 @@ #include #include "storage.h" #include "LittleFS.h" -#include +#include "SPIFFSEditor.h" #include #include // https://github.com/tzapu/WiFiManager/tree/feature_asyncwebserver