1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Fix handling of / to load index.htm (#1085)

Thanks @sticilface
This commit is contained in:
Ivan Grokhotkov 2015-11-30 08:43:08 +03:00
parent 5a2af5419b
commit a6e01b8d27

View File

@ -81,11 +81,12 @@ public:
String path(_path);
if(path.endsWith("/")) path += "index.htm";
if (!_isFile) {
// Base URI doesn't point to a file. Append whatever follows this
// URI in request to get the file path.
// Base URI doesn't point to a file.
// If a directory is requested, look for index file.
if (requestUri.endsWith("/")) requestUri += "index.htm";
// Append whatever follows this URI in request to get the file path.
path += requestUri.substring(_baseUriLength);
}
DEBUGV("StaticRequestHandler::handle: path=%s, isFile=%d\r\n", path.c_str(), _isFile);