Skip to content

Commit b9349dc

Browse files
authored
Filename always with leading slash (Aircoookie#7)
1 parent ebbfed3 commit b9349dc

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

library.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
{
2-
"name":"ESP Async WebServer",
2+
"name":"ESPAsyncWebServerAircoookie",
33
"description":"Asynchronous HTTP and WebSocket Server Library for ESP8266 and ESP32 (Aircoookie fork)",
44
"keywords":"http,async,websocket,webserver",
5-
"authors":
6-
{
7-
"name": "Hristo Gochkov",
8-
"maintainer": true
9-
},
5+
"authors": [
6+
{
7+
"name": "Hristo Gochkov"
8+
},
9+
{
10+
"name": "Christian Schwinne",
11+
"maintainer": true
12+
}
13+
],
1014
"repository":
1115
{
1216
"type": "git",
13-
"url": "https://github.com/me-no-dev/ESPAsyncWebServer.git"
17+
"url": "https://github.com/Aircoookie/ESPAsyncWebServer.git"
1418
},
15-
"version": "2.0.6",
19+
"version": "2.0.7",
1620
"license": "LGPL-3.0",
1721
"frameworks": "arduino",
1822
"platforms": ["espressif8266", "espressif32"],

library.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name=ESP Async WebServer
2-
version=2.0.6
2+
version=2.0.7
33
author=Me-No-Dev
4-
maintainer=Me-No-Dev
4+
maintainer=Aircoookie
55
sentence=Async Web Server for ESP8266 and ESP31B (Aircoookie fork)
66
paragraph=Async Web Server for ESP8266 and ESP31B
77
category=Other
8-
url=https://github.com/me-no-dev/ESPAsyncWebServer
8+
url=https://github.com/Aircoookie/ESPAsyncWebServer
99
architectures=*

src/SPIFFSEditor.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,12 @@ void SPIFFSEditor::handleRequest(AsyncWebServerRequest *request){
354354
String fname = entry.name();
355355
if (fname.indexOf("wsec") == -1) {
356356
if (output != "[") output += ',';
357-
output += "{\"type\":\"";
358-
output += "file";
359-
output += "\",\"name\":\"";
357+
output += "{\"type\":\"file\",\"name\":\"";
358+
if (fname[0] != '/') output += '/';
360359
output += fname;
361360
output += "\",\"size\":";
362361
output += String(entry.size());
363-
output += "}";
362+
output += '}';
364363
}
365364
#ifdef ESP32
366365
entry = dir.openNextFile();
@@ -371,7 +370,7 @@ void SPIFFSEditor::handleRequest(AsyncWebServerRequest *request){
371370
#ifdef ESP32
372371
dir.close();
373372
#endif
374-
output += "]";
373+
output += ']';
375374
request->send(200, "application/json", output);
376375
output = String();
377376
}

0 commit comments

Comments
 (0)