From fa8a1c38d5041dddaeda1ad9671e1c9e2b133b2f Mon Sep 17 00:00:00 2001 From: "M. Betz" Date: Wed, 30 Sep 2020 05:24:59 -0700 Subject: [PATCH] fix #4071 (#4072) SPIFFS File object evaluates as true even if the file could not be opened. --- libraries/WebServer/src/detail/RequestHandlersImpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/WebServer/src/detail/RequestHandlersImpl.h b/libraries/WebServer/src/detail/RequestHandlersImpl.h index 153fbce6..27a2a8d3 100644 --- a/libraries/WebServer/src/detail/RequestHandlersImpl.h +++ b/libraries/WebServer/src/detail/RequestHandlersImpl.h @@ -113,7 +113,7 @@ public: } File f = _fs.open(path, "r"); - if (!f) + if (!f || !f.available()) return false; if (_cache_header.length() != 0)