mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-06 05:21:22 +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:
parent
16319da63d
commit
d990ff9547
@ -80,7 +80,7 @@ public:
|
|||||||
else {
|
else {
|
||||||
_isFile = false;
|
_isFile = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUGV("StaticRequestHandler: path=%s uri=%s isFile=%d, cache_header=%s\r\n", path, uri, _isFile, cache_header);
|
DEBUGV("StaticRequestHandler: path=%s uri=%s isFile=%d, cache_header=%s\r\n", path, uri, _isFile, cache_header);
|
||||||
_baseUriLength = _uri.length();
|
_baseUriLength = _uri.length();
|
||||||
}
|
}
|
||||||
@ -134,6 +134,11 @@ public:
|
|||||||
if (!f)
|
if (!f)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!f.isFile()) {
|
||||||
|
f.close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (_cache_header.length() != 0)
|
if (_cache_header.length() != 0)
|
||||||
server.sendHeader("Cache-Control", _cache_header);
|
server.sendHeader("Cache-Control", _cache_header);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user