From b9349dc7b5635fd7a9abce16bf49ad6a8aae817d Mon Sep 17 00:00:00 2001 From: Christian Schwinne Date: Tue, 4 Oct 2022 02:27:04 +0200 Subject: [PATCH] Filename always with leading slash (#7) --- library.json | 20 ++++++++++++-------- library.properties | 6 +++--- src/SPIFFSEditor.cpp | 9 ++++----- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/library.json b/library.json index 1eef2bd7f..43c6f5e54 100644 --- a/library.json +++ b/library.json @@ -1,18 +1,22 @@ { - "name":"ESP Async WebServer", + "name":"ESPAsyncWebServerAircoookie", "description":"Asynchronous HTTP and WebSocket Server Library for ESP8266 and ESP32 (Aircoookie fork)", "keywords":"http,async,websocket,webserver", - "authors": - { - "name": "Hristo Gochkov", - "maintainer": true - }, + "authors": [ + { + "name": "Hristo Gochkov" + }, + { + "name": "Christian Schwinne", + "maintainer": true + } + ], "repository": { "type": "git", - "url": "https://github.com/me-no-dev/ESPAsyncWebServer.git" + "url": "https://github.com/Aircoookie/ESPAsyncWebServer.git" }, - "version": "2.0.6", + "version": "2.0.7", "license": "LGPL-3.0", "frameworks": "arduino", "platforms": ["espressif8266", "espressif32"], diff --git a/library.properties b/library.properties index 3b5e33440..d6a083c9f 100644 --- a/library.properties +++ b/library.properties @@ -1,9 +1,9 @@ name=ESP Async WebServer -version=2.0.6 +version=2.0.7 author=Me-No-Dev -maintainer=Me-No-Dev +maintainer=Aircoookie sentence=Async Web Server for ESP8266 and ESP31B (Aircoookie fork) paragraph=Async Web Server for ESP8266 and ESP31B category=Other -url=https://github.com/me-no-dev/ESPAsyncWebServer +url=https://github.com/Aircoookie/ESPAsyncWebServer architectures=* diff --git a/src/SPIFFSEditor.cpp b/src/SPIFFSEditor.cpp index 3e9362ba4..b6289651c 100644 --- a/src/SPIFFSEditor.cpp +++ b/src/SPIFFSEditor.cpp @@ -354,13 +354,12 @@ void SPIFFSEditor::handleRequest(AsyncWebServerRequest *request){ String fname = entry.name(); if (fname.indexOf("wsec") == -1) { if (output != "[") output += ','; - output += "{\"type\":\""; - output += "file"; - output += "\",\"name\":\""; + output += "{\"type\":\"file\",\"name\":\""; + if (fname[0] != '/') output += '/'; output += fname; output += "\",\"size\":"; output += String(entry.size()); - output += "}"; + output += '}'; } #ifdef ESP32 entry = dir.openNextFile(); @@ -371,7 +370,7 @@ void SPIFFSEditor::handleRequest(AsyncWebServerRequest *request){ #ifdef ESP32 dir.close(); #endif - output += "]"; + output += ']'; request->send(200, "application/json", output); output = String(); }