From 605064b0d228d56a3bd23ddd4dd9a845b06f7c1f Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 16 Nov 2019 16:00:45 -0700 Subject: [PATCH] Only add "l" to XX.htm URLs if XX.html exists Fixes #6792 Only append the "l" to ".htm" when there actually is a ".html" file present. If not, fall-thru like before and try .gz through the normal paths. --- libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h index e9b8689c04..33895d8a7c 100644 --- a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h +++ b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h @@ -102,7 +102,7 @@ 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")) { + if (!_fs.exists(path) && path.endsWith(".htm") && _fs.exists(path + "l")) { path += "l"; } }