diff --git a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h index b29f159a37..1c44f7833f 100644 --- a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h +++ b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h @@ -110,7 +110,9 @@ 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") && _fs.exists(path + "l")) { + // If neither nor .gz exist, and is a file.htm, try it with file.html instead + // For the normal case this will give a search order of index.htm, index.htm.gz, index.html, index.html.gz + if (!_fs.exists(path) && !_fs.exists(path + ".gz") && path.endsWith(".htm")) { path += "l"; } }