URL template match by extension (#751)

Changes to be committed:
modified:   src/WebHandlerImpl.h
This commit is contained in:
Viktr
2020-11-15 19:21:19 +02:00
committed by GitHub
parent 241aca38a0
commit f6fff3f91e

View File

@@ -105,6 +105,13 @@ class AsyncCallbackWebHandler: public AsyncWebHandler {
} }
} else } else
#endif #endif
if (_uri.length() && _uri.startsWith("/*.")) {
String uriTemplate = String (_uri);
uriTemplate = uriTemplate.substring(uriTemplate.lastIndexOf("."));
if (!request->url().endsWith(uriTemplate))
return false;
}
else
if (_uri.length() && _uri.endsWith("*")) { if (_uri.length() && _uri.endsWith("*")) {
String uriTemplate = String(_uri); String uriTemplate = String(_uri);
uriTemplate = uriTemplate.substring(0, uriTemplate.length() - 1); uriTemplate = uriTemplate.substring(0, uriTemplate.length() - 1);