From 92eb9d43f89051eea2c29bb53e70ad76c866a115 Mon Sep 17 00:00:00 2001 From: George Talusan Date: Mon, 17 Oct 2016 21:16:56 -0400 Subject: [PATCH] fallback onto index.html if index.htm fails --- 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 8c222b78ec..0aa72fdb08 100644 --- a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h +++ b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h @@ -88,6 +88,10 @@ class StaticRequestHandler : public RequestHandler { // 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);