1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Improve LittleFS support (#7071)

Previously, when the path was a directory, but didn't have a slash at
the end, a 0 byte response would be sent when using LittleFS. Now, it
will return a 404, like was always the case when using SPIFFS.
This commit is contained in:
JasperHorn 2020-02-23 09:38:40 +01:00 committed by GitHub
parent 16319da63d
commit d990ff9547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,7 +80,7 @@ public:
else {
_isFile = false;
}
DEBUGV("StaticRequestHandler: path=%s uri=%s isFile=%d, cache_header=%s\r\n", path, uri, _isFile, cache_header);
_baseUriLength = _uri.length();
}
@ -134,6 +134,11 @@ public:
if (!f)
return false;
if (!f.isFile()) {
f.close();
return false;
}
if (_cache_header.length() != 0)
server.sendHeader("Cache-Control", _cache_header);