diff --git a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h index 54522b1d9..4ff6a3a42 100644 --- a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h +++ b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h @@ -67,8 +67,8 @@ public: if (requestMethod != HTTP_GET) return false; - if (!requestUri.startsWith(_uri)) - return false; + if (_isFile && requestUri != _uri || !requestUri.startsWith(_uri)) + return false; return true; } @@ -88,11 +88,6 @@ public: // URI in request to get the file path. path += requestUri.substring(_baseUriLength); } - - else if (requestUri != _uri) { - // Base URI points to a file but request doesn't match this URI exactly - return false; - } DEBUGV("StaticRequestHandler::handle: path=%s, isFile=%d\r\n", path.c_str(), _isFile); String contentType = getContentType(path);