From 9f2cfb82184176a0930303be05791d0aaac1e918 Mon Sep 17 00:00:00 2001 From: George Talusan Date: Tue, 29 Oct 2019 19:25:03 -0400 Subject: [PATCH] fallback onto index.html if index.htm fails (#2614) --- libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h index 1c930aed7..e9b8689c0 100644 --- a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h +++ b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h @@ -101,6 +101,10 @@ public: // Append whatever follows this URI in request to get the file path. path += requestUri.substring(_baseUriLength); + + if (!_fs.exists(path) && path.endsWith(".htm")) { + path += "l"; + } } DEBUGV("StaticRequestHandler::handle: path=%s, isFile=%d\r\n", path.c_str(), _isFile);